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 {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-family: sans-serif;
scroll-behavior: smooth;
text-rendering: optimizeLegibility;
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,21 +1,21 @@
.hint {
padding: 1em;
line-height: 2;
margin: 1rem 0;
margin-block: 1rem;
}
.hint,
.hint.info,
.hint.tip {
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 {
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 {
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) {
grid-template-columns: 3em 1fr;
}
margin: 1em 0;
margin-block: 1em;
padding: 1em;
border-radius: 6px;
text-decoration: none;
&__icon {
height: 3em;
width: 3em;
block-size: 3em;
inline-size: 3em;
grid-column: 1;
background: var(--primary-accent);
color: var(--primary-accent-text);
@ -35,8 +35,8 @@
grid-column: 2 / -1;
}
svg {
height: 1.5em;
width: 1.5em;
block-size: 1.5em;
inline-size: 1.5em;
}
}
@ -56,7 +56,7 @@
font-weight: 700;
}
&__path {
margin-top: 8px;
margin-block-start: 8px;
display: block;
font-family: monospace;
}

View file

@ -133,10 +133,14 @@
</style>
<script>
var body = document.body;
var switcher = document.getElementsByClassName('js-toggle')[0];
var input = document.getElementsByClassName('js-toggle-screenreader-only')[0];
var switcher = document.getElementsByClassName('js-toggle');
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) => {
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
if (localStorage.getItem('colorMode') == 'dark') {
//body.classList.add('dark-mode');