Created
April 3, 2026 11:24
-
-
Save atelierbram/60f148e17a5f68cf8a75d761a618c157 to your computer and use it in GitHub Desktop.
CSS reset / starter (in SCSS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @use "sass:color"; | |
| @use "../mq/mq" as *; | |
| // @use "../settings/settings" as *; | |
| @use "../settings/variables" as *; | |
| html { | |
| cursor: auto; | |
| font-size: 16px; | |
| line-height: 1.5; | |
| -moz-tab-size: 2; | |
| tab-size: 2; | |
| -webkit-tap-highlight-color: transparent; | |
| -webkit-text-size-adjust: 100%; | |
| -moz-text-size-adjust: none; | |
| -webkit-text-size-adjust: none; | |
| text-size-adjust: none; | |
| overflow-wrap: break-word; // Breaks words to prevent overflow in all browsers | |
| scroll-behavior: smooth; | |
| scrollbar-gutter: stable; // https://www.youtube.com/watch?v=qI5rXLJnxco prevents width differences between pages 'cause even without scrollbar the width of it is set | |
| interpolate-size: allow-keywords; // allows for animation on `height: 0; to height: auto` (for example with details[open] / content ~ accordions); | |
| } | |
| @media (prefers-reduced-motion: reduce) { | |
| html { | |
| scroll-behavior: auto !important; | |
| } | |
| } | |
| html, | |
| body { | |
| background-color: $color_bg; | |
| } | |
| body { | |
| font: 100%/1.5 $ff-bodytext; | |
| background-color: $color_bg; | |
| color: $color_text; | |
| letter-spacing: $letter_spacing; | |
| text-rendering: optimizeLegibility; | |
| position: relative; | |
| min-height: 100svh; | |
| } | |
| html, | |
| body { | |
| scrollbar-width: thin; | |
| // scrollbar-color: var(--grayscale-14) var(--grayscale-6); | |
| scrollbar-color: $color_bg adjust-color($color_bg, $lightness: -5%); | |
| } | |
| *, | |
| ::before, | |
| ::after { | |
| box-sizing: border-box; | |
| } | |
| ::before, | |
| ::after { | |
| text-decoration: inherit; | |
| vertical-align: inherit; | |
| font-family: inherit; | |
| } | |
| body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { | |
| margin-block-end: 0; | |
| } | |
| // a:where:not(nav a):not([class*="button"]):not(.entry-title a) { | |
| a { | |
| text-decoration: none; | |
| text-underline-offset: 2px; | |
| background-color: transparent; | |
| &:hover { | |
| text-decoration: underline; | |
| } | |
| &:focus { | |
| outline: none; | |
| } | |
| &[href^="mailto"] { | |
| color: inherit; | |
| } | |
| } | |
| a:not([class]) { | |
| text-decoration-skip-ink: auto; | |
| color: currentColor; | |
| } | |
| nav a { | |
| text-decoration: none; | |
| } | |
| button { | |
| // -webkit-appearance: button; | |
| border: none; | |
| background: rgba(#fff,0); | |
| overflow: visible; | |
| } | |
| // a, | |
| // button { | |
| // -ms-touch-action: manipulation; | |
| // } | |
| button, | |
| input, | |
| optgroup, | |
| select, | |
| textarea { | |
| font-size: inherit; | |
| font-family: inherit; | |
| margin: 0; | |
| } | |
| a, | |
| button, | |
| input[type="input"] { | |
| transition: all .3s ease-out; | |
| } | |
| textarea:not([rows]) { | |
| min-height: 10em; | |
| } | |
| // Anything that has been anchored to should have extra scroll margin */ | |
| :target { | |
| scroll-margin-block: 5ex; | |
| } | |
| h1, | |
| h2, | |
| h3, | |
| h4, | |
| dt { | |
| text-wrap: balance; | |
| } | |
| h1, h2, h3, h4, button, input, label { | |
| line-height: 1.15; | |
| } | |
| p, | |
| li { | |
| text-wrap: pretty; | |
| } | |
| img, | |
| svg, | |
| video { | |
| vertical-align: middle; | |
| } | |
| audio, | |
| video { | |
| display: inline-block; | |
| } | |
| img { | |
| max-width: 100%; | |
| display: block; | |
| height: auto; | |
| border-style: none; | |
| } | |
| svg { | |
| max-width: 100%; | |
| } | |
| svg:not([fill]) { | |
| fill: currentColor; | |
| } | |
| svg:not(:root) { | |
| overflow: hidden; | |
| } | |
| .icon-svg { | |
| vertical-align: middle; | |
| } | |
| ul { | |
| list-style: none; | |
| padding: 0; | |
| li { | |
| position: relative; | |
| &::before { | |
| position: absolute; | |
| content: ""; | |
| background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1C5.92 1 1 5.92 1 12s4.92 11 11 11 11-4.92 11-11S18.08 1 12 1Zm0 15c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4Z' style='fill:%2393796c'/%3E%3C/svg%3E"); | |
| top: .55em; | |
| left: -0.8em; | |
| width: 1.5rem; | |
| height: 1.5rem; | |
| background-size: .5rem; | |
| background-repeat: no-repeat; | |
| } | |
| } | |
| &.list-check { | |
| li { | |
| &::before { | |
| background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgb(135,147,108)' d='M.5 12.34 2.79 10l5.89 5.79L21.11 3.41l2.34 2.32L8.68 20.45.5 12.34Z'/%3E%3C/svg%3E"); | |
| background-size: 1rem; | |
| top: .33em; | |
| left: -1.25em; | |
| } | |
| } | |
| } | |
| &.no-bullets { | |
| list-style: none; | |
| list-style-image: none; | |
| margin-left: 0; | |
| li { | |
| &::before { | |
| content: ""; | |
| display: none; | |
| } | |
| } | |
| } | |
| } | |
| ul, | |
| ol { | |
| margin: 0 0 .75em 0; | |
| } | |
| ul + h2, | |
| p + h2, | |
| ul + h3, | |
| p + h3, | |
| ul + button, | |
| p + button { | |
| margin-top: 2rem; | |
| } | |
| hr { | |
| border-style: solid; | |
| border-width: 1px 0 0; | |
| color: inherit; | |
| height: 0; | |
| overflow: visible; | |
| margin-block: 2.5rem; | |
| } | |
| .small, | |
| small, | |
| sup { | |
| font-size: .875em; | |
| } | |
| sup { | |
| position: relative; | |
| top: -.5em; | |
| // font-size: clamp(12px, 75%, 14px); | |
| line-height: 0; | |
| vertical-align: baseline; | |
| } | |
| i { | |
| font-style: italic; | |
| } | |
| ::-webkit-scrollbar { | |
| width: 11px; | |
| background: var(--grayscale-14); | |
| } | |
| ::-webkit-scrollbar-track { | |
| background: var(--grayscale-14); | |
| } | |
| ::-webkit-scrollbar-thumb { | |
| background: var(--grayscale-6); | |
| border-radius: 6px; | |
| // border: 3px solid $a13; | |
| } | |
| ::-moz-selection { | |
| background-color: var(--grayscale-16); | |
| color: var(--grayscale-4); | |
| text-shadow: none; | |
| } | |
| ::selection { | |
| background-color: var(--grayscale-16); | |
| color: var(--grayscale-4); | |
| text-shadow: none; | |
| } | |
| // Chris Coyier CSS starter: https://codepen.io/editor/chriscoyier/pen/0198772a-a759-7dc4-b8fc-1dfdbed39fdb | |
| // https://0198772a-a759-7dc4-b8fc-1dfdbed39fdb.codepenusercontent.com/style.css | |
| // A Modern reset: https://piccalil.li/blog/a-more-modern-css-reset/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment