All the root styles so far

This commit is contained in:
Eryn Wells 2023-09-24 09:21:49 -07:00
parent d18edef261
commit 1fac613c37
7 changed files with 251 additions and 210 deletions

View file

@ -1,247 +1,227 @@
@layer reset, typography, root, layout, template, page, utility;
@layer reset, typography, root, layout, section, page, utility;
:root {
--black: 0, 0, 0;
--sub-dk-gray: 16, 16, 16;
--dk-gray: 32, 32, 32;
--super-dk-gray: 80, 80, 80;
--mid-gray: 128, 128, 128;
--sub-lt-gray: 175, 175, 175;
--lt-gray: 223, 223, 223;
--super-lt-gray: 240, 240, 240;
--white: 255, 255, 255;
--black: 0, 0, 0;
--sub-dk-gray: 16, 16, 16;
--dk-gray: 32, 32, 32;
--super-dk-gray: 80, 80, 80;
--mid-gray: 128, 128, 128;
--sub-lt-gray: 175, 175, 175;
--lt-gray: 223, 223, 223;
--super-lt-gray: 240, 240, 240;
--white: 255, 255, 255;
--lt-blue: 69, 212, 243;
--mid-blue: 26, 169, 239;
--dk-blue: 63, 46, 231;
--purple: 161, 49, 232;
--lilac: 187, 121, 245;
--lt-blue: 69, 212, 243;
--mid-blue: 26, 169, 239;
--dk-blue: 63, 46, 231;
--purple: 161, 49, 232;
--lilac: 187, 121, 245;
--background: var(--white);
--background: var(--white);
--separator-color: rgb(var(--lt-gray));
--header-border-color: var(--separator-color);
--footer-border-color: var(--separator-color);
--separator-color: rgb(var(--lt-gray));
--header-border-color: var(--separator-color);
--footer-border-color: var(--separator-color);
--box-shadow-color: rgba(var(--lt-gray), 0.8);
--header-box-shadow-color: var(--box-shadow-color);
--box-shadow-color: rgba(var(--lt-gray), 0.8);
--header-box-shadow-color: var(--box-shadow-color);
--body-item-spacing: 4rem;
--body-code-background-color: rgb(var(--super-lt-gray));
--body-item-spacing: 4rem;
--body-code-background-color: rgb(var(--super-lt-gray));
--header-series-arrow-foreground-color: rgb(var(--sub-dk-gray));
--header-series-arrow-foreground-color: rgb(var(--sub-dk-gray));
--html-background-color: rgb(var(--background));
--html-background-color: rgb(var(--background));
--nav-bulleted-spacing: 0.75rem;
--nav-bulleted-spacing: 0.75rem;
--platter-background-color: rgba(var(--white), var(--platter-background-opacity));
--platter-background-opacity: 0.6;
--platter-backdrop-filter: blur(10px);
--platter-background-color: rgba(var(--white), var(--platter-background-opacity));
--platter-background-opacity: 0.6;
--platter-backdrop-filter: blur(10px);
--content-width: 80rem;
--content-width: 80rem;
--tag-foreground-color: rgb(var(--super-dk-gray));
--tag-background-color: rgb(var(--super-lt-gray));
--tag-spacer-foreground-color: rgb(var(--super-dk-gray));
--tag-hover-background-color: rgb(var(--sub-lt-gray));
--tag-foreground-color: rgb(var(--super-dk-gray));
--tag-background-color: rgb(var(--super-lt-gray));
--tag-spacer-foreground-color: rgb(var(--super-dk-gray));
--tag-hover-background-color: rgb(var(--sub-lt-gray));
--transition-duration: 0.7s;
--transition-duration: 0.7s;
--menu-icon-size: 20px;
--menu-icon-size: 20px;
}
@media (prefers-color-scheme: dark) {
:root {
--background: var(--black);
:root {
--background: var(--black);
--separator-color: rgb(var(--dk-gray));
--box-shadow-color: rgba(var(--dk-gray), 0.8);
--body-code-background-color: rgb(var(--dk-gray));
--separator-color: rgb(var(--dk-gray));
--box-shadow-color: rgba(var(--dk-gray), 0.8);
--body-code-background-color: rgb(var(--dk-gray));
--header-series-arrow-foreground-color: rgb(var(--super-dk-gray));
--header-series-arrow-foreground-color: rgb(var(--super-dk-gray));
--html-background-color: rgb(var(--background));
--html-background-color: rgb(var(--background));
--platter-background-color: rgba(var(--black), var(--platter-background-opacity));
--platter-backdrop-filter: brightness(0.66) blur(10px);
--platter-background-color: rgba(var(--black), var(--platter-background-opacity));
--platter-backdrop-filter: brightness(0.66) blur(10px);
--tag-foreground-color: rgb(var(--sub-lt-gray));
--tag-background-color: rgb(var(--dk-gray));
--tag-spacer-foreground-color: rgb(var(--super-dk-gray));
--tag-hover-background-color: rgb(var(--super-dk-gray));
--tag-hover-foreground-color: rgb(var(--mid-gray));
--tag-foreground-color: rgb(var(--sub-lt-gray));
--tag-background-color: rgb(var(--dk-gray));
--tag-spacer-foreground-color: rgb(var(--super-dk-gray));
--tag-hover-background-color: rgb(var(--super-dk-gray));
--tag-hover-foreground-color: rgb(var(--mid-gray));
}
--twitter-icon: url(/icons/twitter-dark.svg);
--github-icon: url(/icons/github-dark.svg);
--instagram-icon: url(/icons/instagram-dark.svg);
--feed-icon: url(/icons/rss-dark.svg);
}
}
@layer root {
a { text-decoration: none; }
a:hover {
text-decoration: underline;
text-underline-offset: 0.12em;
}
a.hover-only {
color: var(--color);
transition: color 0.2s;
}
a.hover-only:hover {
text-decoration: underline;
transition: color 0.2s;
}
a {
text-decoration: none;
}
blockquote {
border-inline-start: 4px solid var(--separator-color);
padding-inline-start: 2rem;
margin-inline-start: 2rem;
}
a:hover {
text-decoration: underline;
text-decoration-style: solid;
}
code {
background-color: var(--body-code-background-color);
border-radius: 0.25rem;
display: inline-block;
padding-inline: 0.6rem;
}
code.nobg {
background: none;
border-radius: 0;
display: inline-block;
margin: 0;
padding: 0;
}
a.hover-only {
color: var(--color);
transition: color 0.2s;
}
details { width: 100%; }
a.hover-only:hover {
text-decoration: underline;
transition: color 0.2s;
}
details:has(#TableOfContents) {
box-sizing: border-box;
border: 1px solid var(--separator-color);
padding: var(--body-item-spacing);
}
blockquote {
--line-width: 4px;
fieldset {
box-sizing: border-box;
border: 1px solid var(--separator-color);
padding: var(--body-item-spacing);
padding-top: calc(var(--body-item-spacing) / 10);
}
border-inline-start: var(--line-width) solid var(--separator-color);
padding-inline-start: calc(3rem - var(--line-width));
margin-block: 0;
margin-inline: 0;
}
html { background-color: var(--html-background-color); }
code {
background-color: var(--body-code-background-color);
border-radius: 0.25rem;
display: inline-block;
padding-inline: 0.6rem;
}
img {
height: auto;
max-width: 100%;
}
code.nobg {
background: none;
border-radius: 0;
display: inline-block;
margin: 0;
padding: 0;
}
img.circular {
shape-outside: circle(50%);
-webkit-clip-path: circle(50%);
clip-path: circle(50%);
}
details {
width: 100%;
}
main {
box-sizing: border-box;
max-width: calc(var(--content-width) + 2 * var(--body-item-spacing));
margin: var(--body-item-spacing) auto;
padding-inline: var(--body-item-spacing);
width: 100%;
}
details:has(#TableOfContents) {
box-sizing: border-box;
border: 1px solid var(--separator-color);
padding: var(--body-item-spacing);
}
nav.bulleted > li:first-child::before {
content: "";
margin-inline: 0;
}
fieldset {
box-sizing: border-box;
border: 1px solid var(--separator-color);
padding: var(--body-item-spacing);
padding-top: calc(var(--body-item-spacing) / 10);
}
nav.bulleted > li::before {
color: var(--heading-color);
content: "•";
font-size: 60%;
font-weight: normal;
opacity: 80%;
margin-inline: var(--nav-bulleted-spacing);
}
html {
background-color: var(--html-background-color);
}
ul,
ol,
dl,
ul > li,
ol > li,
dl > dt,
ul > li > ul,
ul > li > ol,
ol > li > ul,
ol > li > ol {
margin-inline-start: calc(var(--body-item-spacing) + 2px);
}
img {
height: auto;
max-width: 100%;
width: 100%;
}
header > span.series {
font-size: 1.75rem;
letter-spacing: 1px;
margin-inline-start: 0.5em;
}
img.circular {
shape-outside: circle(50%);
-webkit-clip-path: circle(50%);
clip-path: circle(50%);
}
header > span.series::before {
color: var(--header-series-arrow-foreground-color);
content: "↳";
margin-inline-end: 0.25em;
}
main {
box-sizing: border-box;
margin-block-start: var(--body-item-spacing);
width: 100%;
}
.post-list {
list-style: none;
margin: 0;
padding: 0;
}
@supports (display: subgrid) {
.post-list {
align-items: baseline;
display: grid;
gap: 1em;
grid-template-columns:
minmax(150px, max-content) minmax(20px, max-content) 3px auto;
grid-template-areas: "month day line title";
}
}
nav.bulleted>li:first-child::before {
content: "";
margin-inline: 0;
}
.post-list li {
align-items: baseline;
border-radius: 6px;
display: grid;
gap: 1em;
padding: 0.1em;
}
nav.bulleted>li::before {
color: var(--heading-color);
content: "•";
font-size: 60%;
font-weight: normal;
opacity: 80%;
margin-inline: var(--nav-bulleted-spacing);
}
.post-title {
align-items: baseline;
display: flex;
flex-wrap: wrap;
gap: 0 4rem;
}
ul,
ol,
dl,
ul>li,
ol>li,
dl>dt {
margin-inline-start: calc(var(--body-item-spacing) + 2px);
}
.post-title h1 {
flex-grow: 1;
font-size: 1.8em;
margin-block: 0;
padding-bottom: 0;
}
ul>li>ul,
ul>li>ol,
ol>li>ul,
ol>li>ol {
margin-inline-start: 0;
}
.post-title > .post-date {
color: var(--light-dim);
display: inline-block;
font-size: 1.75rem;
inline-size: min-content;
letter-spacing: 1px;
margin-block-start: 0.5rem;
white-space: nowrap;
}
:is(ul, ol) > li {
margin-block-start: 1rem;
}
table {
border: 1px solid var(--separator-color);
border-collapse: collapse;
margin-inline: auto;
width: 50%;
}
header>span.series {
font-size: 1.75rem;
letter-spacing: 1px;
margin-inline-start: 0.5em;
}
td, th {
border: 1px solid var(--separator-color);
padding-inline: 1rem;
}
header>span.series::before {
color: var(--header-series-arrow-foreground-color);
content: "↳";
margin-inline-end: 0.25em;
}
table {
border: 1px solid var(--separator-color);
border-collapse: collapse;
margin-inline: auto;
width: 50%;
}
td,
th {
border: 1px solid var(--separator-color);
padding-inline: 1rem;
}
p, ul {
grid-column: content-start / content-end;
}
}

View file

@ -1,6 +1,5 @@
@layer root {
figcaption {
margin-block-start: 0.2em;
text-align: center;
}
@ -9,17 +8,25 @@
}
figure {
grid-column: content-start / content-end;
margin: 0;
margin-inline: 0;
min-width: fit-content;
overflow: hidden;
max-width: var(--content-width);
}
@media (max-width: 415px) {
figure {
grid-column: wide-content-start / wide-content-end;
}
}
figure > .container {
align-items: center;
display: flex;
justify-content: center;
gap: var(--body-item-spacing);
justify-content: center;
min-width: fit-content;
}
figure.bordered {
@ -38,6 +45,12 @@
max-width: var(--content-width);
}
@media (max-width: 414px) {
figure img {
max-width: 100%;
}
}
figure svg {
width: 100%;
height: auto;

View file

@ -0,0 +1,47 @@
@layer root {
.page {
gap: var(--body-item-spacing) 0;
}
.page > header {
align-items: first baseline;
column-gap: 4rem;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
@media (max-width: 539px) {
.page > header {
grid-template-columns: auto;
}
}
.page > header > time {
}
.page > header,
.page > footer {
grid-column: content-start / content-end;
}
.page > header > :is(h1, h2, h3, h4, h5, h6) {
grid-column: 1;
}
.page > header > time {
grid-column: 2;
}
.page > article > * {
grid-column: gutter-start / gutter-end;
}
.page > article > :not(blockquote, figure.code) {
margin-inline: var(--gutter-width);
}
.page > article > :not(:last-child) {
margin-block-end: var(--body-item-spacing);
}
}

View file

@ -1,8 +0,0 @@
@layer root {
main > :first-child,
main > article > :first-child { margin-block-start: 0; }
main > :not(:last-child),
main > article > :not(:last-child) { margin-block-end: var(--body-item-spacing); }
main > :last-child,
main > article > :last-child { margin-block-end: 0; }
}

View file

@ -0,0 +1,5 @@
aside#table-of-contents {
grid-column: wide-content-right / margin-right;
grid-row: 1 / -1;
}

View file

@ -33,6 +33,7 @@
--color: rgba(var(--black), 0.8);
--a-color: rgb(var(--mid-blue));
--a-underline-color: rgb(var(--sub-lt-gray));
--a-ruby-color: var(--color);
--heading-color: rgb(var(--black));
--site-nav-link-color: var(--a-color);

View file

@ -1,6 +1,9 @@
@layer utility {
.centered { text-align: center; }
.float-right { float: right; }
.float-right {
float: right;
justify-self: end;
}
.nobreak { white-space: nowrap; }
.noselect {