@use "reset"; @use "typography"; @use "colors"; @use "syntax"; // Global Styles body { width: 100%; height: 100%; margin: 0 auto; scroll-behavior: smooth; background-color: var(--background-outer); font-family: typography.$font-stack-sans; font-kerning: normal; font-variant-ligatures: normal; font-feature-settings: "kern", "liga", "calt", "clig", "ss01"; // global base font size: font-size: 0.975em; line-height: 1.5; } code, kbd, samp, pre, .monospace { font-family: typography.$font-stack-mono; letter-spacing: normal; } // override above font-family if browser supports variable fonts // https://caniuse.com/#feat=variable-fonts @supports (font-variation-settings: normal) { body { font-family: typography.$font-stack-sans-variable; font-optical-sizing: auto; } code, kbd, samp, pre, .monospace { font-family: typography.$font-stack-mono-variable; } // Chrome doesn't automatically slant multi-axis Inter var, for some reason. // Adding "slnt" -10 fixes Chrome but then over-italicizes in Firefox. AHHHHHHHHHH. em { font-style: normal !important; font-variation-settings: "ital" 1, "slnt" -10; // Roboto Mono doesn't have this problem, but the above fix breaks it, of course. code, kbd, samp, pre, .monospace { font-style: italic !important; } } } a { color: var(--link); // also set in JSX (pages/_app.tsx) text-decoration: none; background-position: 0% 100%; background-repeat: no-repeat; background-size: 0% 2px; padding-bottom: 2px; transition: background-size 0.25s ease-in-out; background-image: linear-gradient(var(--link-underline), var(--link-underline)); &:hover { background-size: 100% 2px; } } // set an anchor's class to `no-underline` to disable all of this .no-underline { background: none !important; padding-bottom: 0; } // make SVG icons relative to surrounding text // https://github.com/twitter/twemoji#inline-styles .icon { display: inline-block; height: 1.2em; width: 1.2em; margin: 0 0.05em; vertical-align: -0.22em; border: 0; cursor: inherit; } // all code code { font-size: 0.925em; letter-spacing: normal; page-break-inside: avoid; } // inline code in paragraphs/elsewhere (single backticks) :not(pre) > code { padding: 0.075em 0.25em; border: 1px solid var(--kinda-light); } .center { text-align: center; margin-left: auto; margin-right: auto; } // AnchorJS styles .h-anchor { margin: 0 0.25em; padding: 0 0.25em; color: var(--medium-light) !important; background: none !important; font-weight: 300; line-height: 1; opacity: 0; // overridden by JS on mobile devices user-select: none; &::before { content: "\0023"; // pound sign } &:hover { color: var(--link) !important; } } h2, h3, h4 { &:hover { .h-anchor { opacity: 1; } } } // https://web.dev/prefers-reduced-motion/#(bonus)-forcing-reduced-motion-on-all-websites @media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation-delay: -1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; transition-delay: 0s !important; } }