misc style fixes

This commit is contained in:
a 2022-12-23 05:21:41 -06:00
parent 00a1a1cc17
commit cd5cfd63a0
17 changed files with 124 additions and 125 deletions

View file

@ -10,7 +10,7 @@ $sidebar-width: 20rem;
} }
html { html {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; font-family: sans-serif;
scroll-behavior: smooth; scroll-behavior: smooth;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
} }

View file

@ -8,14 +8,14 @@
h6 {font-size: 1em} h6 {font-size: 1em}
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
line-height: 1.2; line-height: 1.2;
margin-bottom: 1rem; margin-block-start: 2rem;
margin-top: 2rem; margin-block-end: 1rem;
font-weight: 700; font-weight: 700;
} }
p { p {
line-height: 2; line-height: 2;
margin-bottom: 1em; margin-block-end: 1em;
max-width: 80ch; max-inline-size: 80ch;
} }
a { a {
word-wrap: break-word; word-wrap: break-word;
@ -28,7 +28,7 @@
sup { sup {
position: relative; position: relative;
font-size: var(--script-size); font-size: var(--script-size);
top: -1em; inset-block-start: -1em;
} }
sub { sub {
position: relative; position: relative;
@ -66,9 +66,8 @@
mark { mark {
background: var(--primary-accent-transparent); background: var(--primary-accent-transparent);
color: var(--ui-text); color: var(--ui-text);
--pad-x-highlight: 0.125em; --pad-highlight: 0.125em;
padding-left: var(--pad-x-highlight); padding-inline: var(--pad-highlight);
padding-right: var(--pad-x-highlight);
transition: transition:
background var(--color-crossfade-duration) var(--color-crossfade-ease), background var(--color-crossfade-duration) var(--color-crossfade-ease),
color var(--color-crossfade-duration) var(--color-crossfade-ease); color var(--color-crossfade-duration) var(--color-crossfade-ease);
@ -81,21 +80,21 @@
color var(--color-crossfade-duration) var(--color-crossfade-ease); color var(--color-crossfade-duration) var(--color-crossfade-ease);
} }
/* lists */ /* lists */
ul {list-style: disc; margin: 1em 0;} ul {list-style: disc; margin-block: 1em;}
li {margin-bottom: 1em; line-height: 1.4; margin-left: 1em;} li {margin-inline-start: 1em; margin-block-end: 1em; line-height: 1.4;}
ol {list-style: decimal; margin: 1em 0;} ol {list-style: decimal; margin-block: 1em;}
dl {margin: 1em 0; line-height: 1.4;} dl {margin-block: 1em; line-height: 1.4;}
dt {font-weight: 700;} dt {font-weight: 700;}
dd {margin-left: 1em; margin-bottom: 1em;} dd {margin-inline-start: 1em; margin-block-end: 1em;}
/* block elements */ /* block elements */
img { img {
width: 100%; inline-size: 100%;
margin-bottom: 1em; margin-block-end: 1em;
} }
blockquote { blockquote {
font-style: italic; font-style: italic;
font-size: 1.3rem; font-size: 1.3rem;
margin: 1em 0; margin-block: 1em;
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
line-height: 1.4; line-height: 1.4;
cite { cite {
@ -111,11 +110,11 @@
color var(--color-crossfade-duration) var(--color-crossfade-ease); color var(--color-crossfade-duration) var(--color-crossfade-ease);
padding: 1em; padding: 1em;
line-height: 2; line-height: 2;
overflow-x: auto; overflow-inline: auto;
white-space: pre; white-space: pre;
display: grid; display: grid;
tab-size: 3; tab-size: 3;
margin-bottom: 1em; margin-block-end: 1em;
} }
code { code {
font-family: monospace; font-family: monospace;
@ -137,29 +136,30 @@
padding: 0; padding: 0;
} }
code .line { code .line {
padding: 0 1em; padding-inline: 1em;
} }
.highlight pre { .highlight pre {
padding: 1em 0; padding-block: 1em;
} }
/* figures */ /* figures */
figure { figure {
margin-bottom: 1em; margin-block: 1em;
display: grid;
place-items: center;
} }
figure img { figure img {
width: 100%; inline-size: max-content;
margin-bottom: -0.125em; max-inline-size: 100%;
margin-block-end: -0.125em;
} }
figcaption { figcaption {
background: #212121;
color: white;
transition:
background var(--color-crossfade-duration) var(--color-crossfade-ease),
color var(--color-crossfade-duration) var(--color-crossfade-ease);
font-style: italic; font-style: italic;
padding: 1em;
font-size: 0.8em;
line-height: 1.2; line-height: 1.2;
inline-size: 100%;
text-align: center;
p {
margin: 1em auto;
}
} }
/* tables */ /* tables */
table {text-align: center;} table {text-align: center;}
@ -209,9 +209,9 @@
} }
&:after { &:after {
content: ''; content: '';
width: 100%; inline-size: 100%;
margin-left: 1rem; margin-inline-start: 1rem;
border-bottom: 1px solid; border-block-end: 1px solid;
border-color: var(--ui-text-muted); border-color: var(--ui-text-muted);
transition: transition:
border-color var(--color-crossfade-duration) var(--color-crossfade-ease); border-color var(--color-crossfade-duration) var(--color-crossfade-ease);

View file

@ -2,11 +2,11 @@
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
li { li {
margin-bottom: 1rem; margin-inline-start: 1rem;
margin-right: 0.5rem; margin-inline-end: 0.5rem;
margin-left: 1rem; margin-block-end: 1rem;
a { a {
margin-left: 0.5rem; margin-inline-start: 0.5rem;
} }
&::marker { &::marker {
content: "» "; content: "» ";

View file

@ -16,39 +16,39 @@
.toggle-menu__label { .toggle-menu__label {
margin-bottom: 2em margin-block-end: 2em
} }
/* navigation menu */ /* navigation menu */
.docs-nav { .docs-nav {
padding: 1em 0; padding-block: 1em;
#search-form { #search-form {
margin-bottom: 2em; margin-block-end: 2em;
} }
.menu { .menu {
margin-top: 1em; margin-block-start: 1em;
> li { > li {
margin-bottom: 2em; margin-block-end: 2em;
font-weight: 700; font-weight: 700;
} }
> details summary { > details summary {
margin-bottom: 1em; margin-block-end: 1em;
} }
display: flex; display: flex;
flex-flow: column; flex-flow: column;
} }
details { details {
display: flex; display: flex;
margin-bottom: 1em; margin-block-end: 1em;
&[open] {margin-bottom: 2em;} &[open] {margin-block-end: 2em;}
} }
summary { summary {
font-weight: 700; font-weight: 700;
cursor: pointer; cursor: pointer;
} }
.sub-menu { .sub-menu {
margin-left: 1em; margin-inline-start: 1em;
display: flex; display: flex;
flex-flow: column; flex-flow: column;
gap: 0.5rem; gap: 0.5rem;
@ -56,8 +56,8 @@
line-height: 1.5; line-height: 1.5;
} }
.sub-menu { .sub-menu {
margin-top: 0.5rem; margin-block-start: 0.5rem;
margin-left: 2em; margin-inline-start: 2em;
} }
li::marker { li::marker {
content: ''; content: '';
@ -80,13 +80,13 @@
/* top of menu link should show only when focused */ /* top of menu link should show only when focused */
#menu {margin-bottom: 1em;} #menu {margin-block-end: 1em;}
#menu:not(:focus) { #menu:not(:focus) {
clip: rect(0 0 0 0); clip: rect(0 0 0 0);
clip-path: inset(50%); clip-path: inset(50%);
height: 1px; block-size: 1px;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
white-space: nowrap; white-space: nowrap;
width: 1px; inline-size: 1px;
} }

View file

@ -45,5 +45,5 @@
grid-column: 2; grid-column: 2;
} }
} }
margin-bottom: 2em; margin-block-end: 2em;
} }

View file

@ -1,7 +1,7 @@
.site-footer { .site-footer {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 1em 0; padding-block: 1em;
hr {display: none;} hr {display: none;}
@ -29,7 +29,7 @@
} }
a[href='#top'] { a[href='#top'] {
margin-left: auto; margin-inline-start: auto;
} }
.copyright a { .copyright a {

View file

@ -5,16 +5,13 @@
gap: 1em; gap: 1em;
text-decoration: none; text-decoration: none;
img { img {
height: 2rem; block-size: 2rem;
} }
svg { svg {
height: 2rem; block-size: 2rem;
width: 100%; inline-size: 100%;
} }
} }
.site-icon {
height: 2em;
}
.site-title { .site-title {
font-weight: 900; font-weight: 900;
letter-spacing: -0.5px; letter-spacing: -0.5px;
@ -27,8 +24,8 @@
.color-switcher { .color-switcher {
display: grid; display: grid;
place-items: center; place-items: center;
margin-left: auto; margin-inline-start: auto;
margin-right: 0.5em; margin-inline-end: 0.5em;
} }
.site-header { .site-header {
@ -38,7 +35,7 @@
justify-content: space-between; justify-content: space-between;
gap: 1em; gap: 1em;
} }
padding: 1em 0; padding-block: 1em;
a { a {
font-weight: 500; font-weight: 500;
} }
@ -46,7 +43,7 @@
display: flex; display: flex;
gap: 1em; gap: 1em;
flex-flow: row wrap; flex-flow: row wrap;
max-width: 100%; max-inline-size: 100%;
flex-grow: 1; flex-grow: 1;
justify-content: space-between; justify-content: space-between;
} }

View file

@ -1,5 +1,5 @@
.toc-title { .toc-title {
margin-bottom: 0.5em; margin-block-end: 0.5em;
font-weight: 900; font-weight: 900;
text-transform: uppercase; text-transform: uppercase;
color: var(--ui-text-muted); color: var(--ui-text-muted);
@ -7,23 +7,17 @@
color var(--color-crossfade-duration) var(--color-crossfade-ease); color var(--color-crossfade-duration) var(--color-crossfade-ease);
} }
#TableOfContents { #TableOfContents {
ul { ol, ul {
list-style: none; list-style: none;
margin: 0;
} }
li { li {
margin: 0; margin-block: 0.5em;
}
a {
display: inline-block;
line-height: 1.5; line-height: 1.5;
} }
li > ul { /* indent subheadings */ li > ol, li > ul { /* indent subheadings */
margin: 0; margin-inline-start: 1em;
margin-left: 1em;
}
ol {
list-style: none;
margin: 0;
}
li > ol {
margin-left: 1em;
} }
} }

View file

@ -1,20 +1,20 @@
h2.heading { h2.heading {
border-bottom: 1px solid var(--ui-text-muted); padding-block-end: 1rem;
padding-bottom: 1rem; border-block-end: 1px solid var(--ui-text-muted);
} }
/* headings with no numbers */ /* headings with no numbers */
article:not([autonumbering]) .heading { article:not([autonumbering]) .heading {
position: relative; position: relative;
margin-right: 2.5rem; margin-inline-end: 2.5rem;
&__anchor-link { &__anchor-link {
display: inline-flex; display: inline-flex;
align-content: center; align-content: center;
margin-left: 0.25em; margin-inline-start: 0.25em;
position: absolute; position: absolute;
right: -2.5rem; inset-inline-end: -2.5rem;
top: 3px; inset-block-start: 3px;
font-size: 1rem; font-size: 1rem;
} }
} }
@ -43,7 +43,7 @@ article[autonumbering] {
h3:before, h3:before,
h4:before h4:before
{ {
margin-right: 1em; margin-inline-end: 1em;
font-family: monospace; font-family: monospace;
font-size: 1rem; font-size: 1rem;
} }
@ -52,7 +52,7 @@ article[autonumbering] {
display: grid; display: grid;
grid-template-columns: 1fr auto; grid-template-columns: 1fr auto;
grid-template-rows: auto auto; grid-template-rows: auto auto;
grid-gap: 0.5rem; gap: 0.5rem;
&__text { &__text {
grid-column: span 2; grid-column: span 2;
} }
@ -75,6 +75,6 @@ article[autonumbering] {
#TableOfContents ol ol, #TableOfContents ol ol,
#TableOfContents ul ul #TableOfContents ul ul
{ {
margin-left: 0; margin-inline-start: 0;
} }
} }

View file

@ -2,7 +2,7 @@
display: block; display: block;
font-size: 2em; font-size: 2em;
line-height: 1; line-height: 1;
margin-bottom: 1em; margin-block-end: 1em;
} }
.search-results strong { .search-results strong {
@ -17,24 +17,24 @@
#search-results { #search-results {
display: flex; display: flex;
flex-flow: column; flex-flow: column;
max-width: 80ch; max-inline-size: 80ch;
} }
#search-results li:not(:first-child) { #search-results li:not(:first-child) {
border-top: 1px solid; border-block-start: 1px solid;
border-color: var(--ui-text-muted); border-color: var(--ui-text-muted);
transition: transition:
border-color var(--color-crossfade-duration) var(--color-crossfade-ease); border-color var(--color-crossfade-duration) var(--color-crossfade-ease);
} }
#search-results li { #search-results li {
padding: 1em 0; padding-block: 1em;
} }
.search-result-page-title { .search-result-page-title {
font-size: 1.25em; font-size: 1.25em;
display: block; display: block;
margin-bottom: 1rem; margin-block-end: 1rem;
} }
.search-result-item p { .search-result-item p {
@ -45,7 +45,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
max-width: 100%; max-inline-size: 100%;
} }
#search-input { #search-input {
@ -58,10 +58,10 @@
border-radius: 100rem; border-radius: 100rem;
border: 0; border: 0;
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
margin-right: 0.5rem; margin-inline-end: 0.5rem;
width: 100%; inline-size: 100%;
flex-shrink: 1; flex-shrink: 1;
height: 2rem; block-size: 2rem;
box-sizing: border-box; box-sizing: border-box;
} }
@ -74,6 +74,6 @@
background var(--color-crossfade-duration) var(--color-crossfade-ease), background var(--color-crossfade-duration) var(--color-crossfade-ease),
color var(--color-crossfade-duration) var(--color-crossfade-ease); color var(--color-crossfade-duration) var(--color-crossfade-ease);
border-radius: 4px; border-radius: 4px;
height: 2rem; block-size: 2rem;
filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.15)); filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.15));
} }

View file

@ -1,12 +1,12 @@
.list-item { .list-item {
margin-bottom: 2rem; margin-block-end: 2rem;
&__title { &__title {
display: inline-block; display: inline-block;
margin-bottom: 0.5rem; margin-block-end: 0.5rem;
font-size: 1.25em; font-size: 1.25em;
} }
&__summary { &__summary {
margin-bottom: 0.5rem; margin-block-end: 0.5rem;
line-height: 1.5; line-height: 1.5;
} }
&__date { &__date {

View file

@ -24,7 +24,7 @@
@media (min-width: 60rem) { @media (min-width: 60rem) {
body { body {
display: grid; display: grid;
grid-template-columns: 1fr 3fr; grid-template-columns: var(--sidebar-width) 1fr;
grid-template-rows: auto 0 1fr auto; grid-template-rows: auto 0 1fr auto;
height: calc(100 * var(--vh, 1vh)); height: calc(100 * var(--vh, 1vh));
} }
@ -78,7 +78,7 @@
@media (min-width: 90rem) { @media (min-width: 90rem) {
body { body {
grid-template-columns: auto 1fr; grid-template-columns: var(--sidebar-width) 1fr;
} }
.page { .page {
display: grid; display: grid;
@ -133,10 +133,10 @@
} }
.page-header { .page-header {
padding-top: 2rem; padding-block-start: 2rem;
} }
.page-footer { .page-footer {
padding-bottom: 1rem; padding-block-end: 1rem;
} }
} }

View file

@ -1,24 +1,24 @@
.breadcrumbs { .breadcrumbs {
margin-bottom: 1rem; margin-block-end: 1rem;
} }
.page-title { .page-title {
font-size: 2em; font-size: 2em;
margin-bottom: 1rem; margin-block-end: 1rem;
} }
.page-summary { .page-summary {
line-height: 1.5; line-height: 1.5;
max-width: 80ch; max-inline-size: 80ch;
margin-bottom: 1rem; margin-block-end: 1rem;
} }
.lastmod { .lastmod {
margin-top: 1rem; margin-block-start: 1rem;
line-height: 1.5; line-height: 1.5;
color: var(--ui-text-muted); color: var(--ui-text-muted);
transition: transition:
color var(--color-crossfade-duration) var(--color-crossfade-ease); color var(--color-crossfade-duration) var(--color-crossfade-ease);
} }
.language-list { .language-list {
margin-top: 0.5rem; margin-block-start: 0.5rem;
display: flex; display: flex;
flex-flow: wrap; flex-flow: wrap;
list-style: none; list-style: none;

View file

@ -56,6 +56,6 @@ a.source-ref[href^="http"]:after {
} }
.content pre code { .content pre code {
width: 100%; inline-size: 100%;
} }

View file

@ -1,21 +1,21 @@
.hint { .hint {
padding: 1em; padding: 1em;
line-height: 2; line-height: 2;
margin: 1rem 0; margin-block: 1rem;
} }
.hint, .hint,
.hint.info, .hint.info,
.hint.tip { .hint.tip {
background: rgba(142, 226, 142, 0.2); background: rgba(142, 226, 142, 0.2);
border-left: 4px solid rgb(142, 226, 142); border-inline-start: 4px solid rgb(142, 226, 142);
} }
.hint.warning { .hint.warning {
background: rgba(218, 226, 142, 0.2); background: rgba(218, 226, 142, 0.2);
border-left: 4px solid rgb(218, 226, 142); border-inline-start: 4px solid rgb(218, 226, 142);
} }
.hint.danger { .hint.danger {
background: rgba(226, 142, 142, 0.2); background: rgba(226, 142, 142, 0.2);
border-left: 4px solid rgb(226, 142, 142); border-inline-start: 4px solid rgb(226, 142, 142);
} }

View file

@ -17,13 +17,13 @@
@media (min-width: 20rem) { @media (min-width: 20rem) {
grid-template-columns: 3em 1fr; grid-template-columns: 3em 1fr;
} }
margin: 1em 0; margin-block: 1em;
padding: 1em; padding: 1em;
border-radius: 6px; border-radius: 6px;
text-decoration: none; text-decoration: none;
&__icon { &__icon {
height: 3em; block-size: 3em;
width: 3em; inline-size: 3em;
grid-column: 1; grid-column: 1;
background: var(--primary-accent); background: var(--primary-accent);
color: var(--primary-accent-text); color: var(--primary-accent-text);
@ -35,8 +35,8 @@
grid-column: 2 / -1; grid-column: 2 / -1;
} }
svg { svg {
height: 1.5em; block-size: 1.5em;
width: 1.5em; inline-size: 1.5em;
} }
} }
@ -56,7 +56,7 @@
font-weight: 700; font-weight: 700;
} }
&__path { &__path {
margin-top: 8px; margin-block-start: 8px;
display: block; display: block;
font-family: monospace; font-family: monospace;
} }

View file

@ -133,10 +133,14 @@
</style> </style>
<script> <script>
var body = document.body; var body = document.body;
var switcher = document.getElementsByClassName('js-toggle')[0]; var switcher = document.getElementsByClassName('js-toggle');
var input = document.getElementsByClassName('js-toggle-screenreader-only')[0]; var input = document.getElementsByClassName('js-toggle-screenreader-only');
switcher.removeAttribute("style") console.log(switcher);
for (s of switcher) {
s.removeAttribute("style");
};
input.addEventListener('focus', (event) => { input.addEventListener('focus', (event) => {
switcher.classList.add('js-toggle--focus'); switcher.classList.add('js-toggle--focus');
@ -165,6 +169,10 @@ if (this.classList.contains('js-toggle--checked')) {
} }
}) })
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
localStorage.setItem('colorMode', 'dark');
}
//Check Storage. Keep user preference on page reload //Check Storage. Keep user preference on page reload
if (localStorage.getItem('colorMode') == 'dark') { if (localStorage.getItem('colorMode') == 'dark') {
//body.classList.add('dark-mode'); //body.classList.add('dark-mode');