styled-css-base
Version:
Lightweight basic CSS style sheets.
445 lines (381 loc) • 13.5 kB
CSS
@media (prefers-color-scheme: light) {
[data-prefers-color-scheme-auto] {
--color: rgba(0, 0, 0, 1);
--background: rgba(255, 255, 255, 1);
--disabled: rgba(243, 244, 246, 1);
--background-lighter: rgba(249, 250, 251, 1);
--background-lighter-alt: rgba(209, 213, 219, 0.5);
--background-darker: rgba(243, 244, 246, 1);
--divider: rgba(209, 213, 219, 1);
--button: rgba(44, 44, 44, 1);
--button-disabled: rgba(15, 23, 42, 0.5);
--button-color: rgba(243, 244, 246, 1);
--button-hover: rgba(22, 23, 24, 0.8);
--slider: rgba(174, 174, 174, 1);
--slider-track: rgba(216, 216, 216, 1);
--checked-tick: url("data:image/svg+xml,<svg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'><path d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/></svg>");
--select-caret: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'><path stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M4 6l3 3 3-3'/></svg>");
}
}
@media (prefers-color-scheme: dark) {
[data-prefers-color-scheme-auto] {
--color: rgba(222, 222, 222, 1);
--background: rgb(52, 52, 52);
--disabled: rgba(15, 23, 42, 0.5);
--background-lighter: rgba(18, 17, 16, 1);
--background-lighter-alt: rgba(30, 22, 26, 0.5);
--background-darker: rgba(24, 22, 20, 1);
--divider: rgba(164, 164, 164, 1);
--button: rgba(44, 44, 44, 1);
--button-disabled: rgba(15, 23, 42, 0.5);
--button-color: rgba(243, 244, 246, 1);
--button-hover: rgba(22, 23, 24, 0.8);
--slider: rgba(174, 174, 174, 1);
--slider-track: rgba(216, 216, 216, 1);
--checked-tick: url("data:image/svg+xml,<svg viewBox='0 0 16 16' fill='black' xmlns='http://www.w3.org/2000/svg'><path d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/></svg>");
--select-caret: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'><path stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M4 6l3 3 3-3'/></svg>");
}
}
[data-prefers-color-scheme-light] {
--color: rgba(0, 0, 0, 1);
--background: rgba(255, 255, 255, 1);
--disabled: rgba(243, 244, 246, 1);
--background-lighter: rgba(249, 250, 251, 1);
--background-lighter-alt: rgba(209, 213, 219, 0.5);
--background-darker: rgba(243, 244, 246, 1);
--divider: rgba(209, 213, 219, 1);
--button: rgba(44, 44, 44, 1);
--button-disabled: rgba(15, 23, 42, 0.5);
--button-color: rgba(243, 244, 246, 1);
--button-hover: rgba(22, 23, 24, 0.8);
--slider: rgba(174, 174, 174, 1);
--slider-track: rgba(216, 216, 216, 1);
--checked-tick: url("data:image/svg+xml,<svg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'><path d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/></svg>");
--select-caret: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'><path stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M4 6l3 3 3-3'/></svg>");
}
[data-prefers-color-scheme-dark] {
--color: rgba(222, 222, 222, 1);
--background: rgb(52, 52, 52);
--disabled: rgba(15, 23, 42, 0.5);
--background-lighter: rgba(18, 17, 16, 1);
--background-lighter-alt: rgba(30, 22, 26, 0.5);
--background-darker: rgba(24, 22, 20, 1);
--divider: rgba(164, 164, 164, 1);
--button: rgba(44, 44, 44, 1);
--button-disabled: rgba(15, 23, 42, 0.5);
--button-color: rgba(243, 244, 246, 1);
--button-hover: rgba(22, 23, 24, 0.8);
--slider: rgba(174, 174, 174, 1);
--slider-track: rgba(216, 216, 216, 1);
--checked-tick: url("data:image/svg+xml,<svg viewBox='0 0 16 16' fill='black' xmlns='http://www.w3.org/2000/svg'><path d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/></svg>");
--select-caret: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'><path stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M4 6l3 3 3-3'/></svg>");
}
*::selection {
background-color: var(--background-darker, rgba(243, 244, 246, 1));
}
* {
color: var(--color, rgba(0, 0, 0, 1));
box-sizing: border-box;
margin: 0;
}
header {
font-size: 1.5em;
text-align: center;
margin-bottom: 0.5em;
}
main {
background: var(--background-darker, rgba(243, 244, 246, 1));
padding: 2em;
}
section {
display: flex;
padding: 1em;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1), 0 0 2px rgba(0, 0, 0, 0.06);
background: var(--background, rgba(255, 255, 255, 1));
border-radius: 0.25em;
margin-bottom: 2em;
}
section section {
background-color: var(--background-lighter, rgba(249, 250, 251, 1));
margin-bottom: 0.5em;
}
section section:not(:last-child) {
margin-right: 2em;
}
article {
flex-grow: 1;
padding: 1em;
background: var(--background, rgba(255, 255, 255, 1));
border-radius: 0.25em;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1), 0 0 2px rgba(0, 0, 0, 0.06);
}
h1 {
font-weight: 600;
font-size: 2em;
}
h2 {
font-weight: 600;
font-size: 1.75em;
}
h3 {
font-weight: 600;
font-size: 1.5em;
}
h4 {
font-weight: 600;
font-size: 1.25em;
}
h5 {
font-weight: 500;
font-size: 1.25em;
}
h6 {
font-weight: 500;
font-size: 1em;
}
p {
font-weight: 400;
font-size: 1em;
}
table, tr, th, td {
border: var(--divider, rgba(209, 213, 219, 1)) solid 1px;
padding: 0.5em 1em;
}
th {
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1), 0 0 2px rgba(0, 0, 0, 0.06);
}
tr:nth-child(odd) {
background-color: var(--background-lighter, rgba(249, 250, 251, 1));
}
thead tr:nth-child(n) {
background-color: var(--background-lighter-alt, rgba(209, 213, 219, 0.5));
}
tfoot tr:nth-child(n) {
background: var(--background-darker, rgba(243, 244, 246, 1));
}
tbody tr:nth-child(odd) {
background-color: var(--background-lighter, rgba(249, 250, 251, 1));
}
th, td {
text-align: left;
}
details {
flex-grow: 1;
display: block;
padding: 0.5em;
background-color: var(--background-lighter, rgba(249, 250, 251, 1));
}
summary {
cursor: pointer;
text-decoration: underline;
text-indent: 0.5em;
margin-bottom: 0.5em;
}
ul, ol {
padding-inline-start: 2em;
padding-inline-end: 1em;
}
ul li:not(:last-child), ol li:not(:last-child) {
margin-bottom: 0.25em;
}
dl {
text-indent: 2em;
margin-bottom: 1em;
padding-inline-end: 1em;
}
dt:not(:last-child), dd:not(:last-child) {
margin-bottom: 0.25em;
}
pre, code, blockquote {
white-space: pre-wrap;
padding: 0.5em;
}
blockquote {
border-left: 4px solid var(--disabled, rgba(15, 23, 42, 0.5));
padding-left: 2em;
}
pre, blockquote {
display: block;
flex-grow: 1;
background-color: var(--background-lighter, rgba(249, 250, 251, 1));
}
label {
font-weight: 600;
display: inline-flex;
align-items: center;
}
input[type=radio], input[type=checkbox], input[type=range], input[type=color], input[type=file], select, button {
cursor: pointer;
}
input[disabled], textarea[disabled], select[disabled], button[disabled], *[disabled] {
cursor: not-allowed;
background-color: var(--disabled, rgba(243, 244, 246, 1));
}
input[disabled]:hover, textarea[disabled]:hover, select[disabled]:hover, button[disabled]:hover, *[disabled]:hover {
outline: none;
}
input, select, textarea {
appearance: none;
padding: 0.5rem;
margin-left: 0.5rem;
border: var(--divider, rgba(209, 213, 219, 1)) solid 1px;
background-color: var(--background, rgba(255, 255, 255, 1));
border-radius: 0.375rem;
}
input[type=number], input[type=text], textarea {
padding-left: 1rem;
padding-right: 1rem;
}
input:focus, select:focus, textarea:focus,
input:hover, select:hover, textarea:hover,
input:focus-visible, select:focus-visible, textarea:focus-visible, {
outline: 1px solid currentColor;
}
input[type=radio] {
border-radius: 50%;
border: 0.1em solid var(--divider, rgba(209, 213, 219, 1));
padding: 0.4em;
box-sizing: border-box;
}
input[type=radio]:checked {
background-color: currentColor;
}
input[type=radio]:focus {
box-shadow: white 0px 0px 0px 1px, currentColor 0px 0px 0px 3px;
}
input[type=checkbox]:checked {
background-image: var(--checked-tick, url("data:image/svg+xml,<svg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'><path d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/></svg>"));
background-size: 1.5em 1.5em;
background-position: center;
background-repeat: no-repeat;
background-color: currentColor;
}
input[type=checkbox]:focus {
box-shadow: transparent 0px 0px 0px 1px, currentColor 0px 0px 0px 3px;
}
input[type=range]::-webkit-slider-thumb {
appearance: none;
width: 1em;
height: 1em;
margin-top: -0.25em;
border-radius: 50%;
background: var(--slider, rgba(174, 174, 174, 1));
}
input[type=range]::-moz-range-thumb {
appearance: none;
width: 1em;
height: 1em;
margin-top: -0.25em;
border-radius: 50%;
background: var(--slider, rgba(174, 174, 174, 1));
}
input[type=range]::-webkit-slider-runnable-track {
transition: background-color 0.2s ease-in-out;
appearance: none;
background-color: var(--background-darker, rgba(243, 244, 246, 1));
height: 0.5em;
}
input[type=range]::-moz-range-track {
transition: background-color 0.2s ease-in-out;
appearance: none;
background-color: var(--background-darker, rgba(243, 244, 246, 1));
height: 0.5em;
}
input[type=range]:hover::-webkit-slider-runnable-track, input[type=range][disabled]::-webkit-slider-runnable-track {
background-color: var(----slider-track, rgba(216, 216, 216, 1));
}
input[type=range]:hover::-moz-range-track, input[type=range][disabled]::-moz-range-track {
background-color: var(----slider-track, rgba(216, 216, 216, 1));
}
input[type=range]:hover::-moz-range-track, input[type=range][disabled]::-moz-range-track {
background-color: var(----slider-track, rgba(216, 216, 216, 1));
}
input[type=file]::file-selector-button {
cursor: inherit;
appearance: none;
border: none;
padding: 0.25em 0.5em;
border-radius: 0.25em;
font-size: 0.5em;
color: var(--background-darker, rgba(0, 0, 0, 1));
background-color: var(--button, rgba(44, 44, 44, 1));
transition: background-color 0.2s ease-in-out;
margin-right: 1em;
}
input[type=file]::file-selector-button:hover {
background-color: var(--button-hover, rgba(22, 23, 24, 0.8));
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1), 0 0 2px rgba(0, 0, 0, 0.06);
}
input[type=color] {
padding: 0.25em;
}
input[type=date]::-webkit-calendar-picker-indicator {
filter: invert(1);
}
select {
background-image: var(--select-caret, url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'><path stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M4 6l3 3 3-3'/></svg>"));
background-position: right 0.5rem center;
background-repeat: no-repeat;
background-size: 1.5em 1.5em;
padding-left: 1rem;
padding-right: 2rem;
}
button, input[type=file]::-webkit-file-upload-button {
appearance: none;
border: none;
padding: 0.5em 1em;
border-radius: 0.25em;
color: var(--button-color, rgba(243, 244, 246, 1));
background-color: var(--button, rgba(44, 44, 44, 1));
transition: background-color 0.2s ease-in-out;
}
button:hover, input[type=file]::-webkit-file-upload-button:hover {
background-color: var(--button-hover, rgba(22, 23, 24, 0.8));
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1), 0 0 2px rgba(0, 0, 0, 0.06);
}
button:focus, input[type=file]::-webkit-file-upload-button:focus {
box-shadow: currentColor 0px 0px 0px 1px, var(--button, rgba(44, 44, 44, 1)) 0px 0px 0px 2px;
}
button[disabled], input[type=file][disabled]::-webkit-file-upload-button {
color: rgba(223, 224, 226, 1);
background-color: var(--button-disabled, rgba(15, 23, 42, 0.5));
}
dialog {
margin: auto;
}
dialog[open] {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
dialog::backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
pointer-events: none;
background-color: rgba(0, 0, 0, 0.2);
backdrop-filter: blur(2px);
overflow: hidden;
}
dialog > *:not(:last-child) {
margin-bottom: 1em;
}
img, iframe {
transition: box-shadow 0.2s ease-in-out;
border: none;
border-radius: 0.25em;
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
background-color: var(--background-lighter, rgba(249, 250, 251, 1));
}
img:hover, iframe:hover {
box-shadow: 0 0 3px 5px rgba(0, 0, 0, 0.1);
}
hr {
margin: 1em 0;
border: none;
border-top: var(--divider, rgba(209, 213, 219, 1)) dashed 1px;
width: 100%;
}