clean up global styles

This commit is contained in:
2022-01-10 16:15:25 -05:00
parent 18e04bdd5f
commit 3864d18ba3
11 changed files with 103 additions and 93 deletions
+1 -54
View File
@@ -20,7 +20,7 @@ a:hover {
background-size: 100% 2px;
}
/* set an anchor's class to `no-underline` to disable all of this */
/* set an anchor's class to `no-underline` to disable all of the above */
.no-underline {
background: none !important;
padding-bottom: 0;
@@ -49,59 +49,6 @@ code {
padding: 0.1em 0.25em;
}
/* code blocks */
pre code {
display: block;
overflow-x: auto;
padding: 1em;
tab-size: 2;
}
/* sub-heading anchor styles */
.h-anchor {
margin: 0 0.25em;
padding: 0 0.25em;
color: var(--medium-light);
background: none;
font-weight: 300;
opacity: 0; /* overridden on hover */
user-select: none;
}
.h-anchor::before {
content: "\0023"; /* pound sign `#`, done here to keep content DOM cleaner */
}
.h-anchor:hover {
color: var(--link);
}
/* make anchor `#` link show up on hover over the corresponding heading */
h2:hover .h-anchor,
h3:hover .h-anchor,
h4:hover .h-anchor {
opacity: 1;
}
/* offset (approximately) with sticky header so jumped-to content isn't hiding behind it */
h2 {
scroll-margin-top: 4em;
}
h3,
h4 {
scroll-margin-top: 5em;
}
@media screen and (max-width: 768px) {
h2 {
scroll-margin-top: 5em;
}
h3,
h4 {
scroll-margin-top: 6em;
}
}
/* https://web.dev/prefers-reduced-motion/#(bonus)-forcing-reduced-motion-on-all-websites */
@media (prefers-reduced-motion: reduce) {
*,