Created
April 6, 2020 23:39
-
-
Save dannysmith/3e4d15914c9b809b447bb7e7538ae545 to your computer and use it in GitHub Desktop.
This file contains 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
// ========================================================================== | |
// Base styles: Global Basics and resets | |
// ========================================================================== | |
html { | |
box-sizing: border-box; | |
font-variant-ligatures: common-ligatures discretionary-ligatures; | |
text-rendering: optimizeLegibility; | |
scroll-behavior: smooth; | |
-webkit-font-smoothing: antialiased; | |
-moz-font-smoothing: greyscale; | |
} | |
// Inherit box-sizing | |
*, | |
*::before, | |
*::after { | |
box-sizing: inherit; | |
} | |
// Body default styles | |
body { | |
font-family: var(--font-ui); | |
background-color: var(--color-white); | |
min-height: 100vh; | |
} | |
//Remove default fieldset styles. | |
fieldset { | |
margin: 0; | |
padding: 0; | |
border: 0; | |
} | |
// Allow only vertical resizing of textareas. | |
textarea { | |
resize: vertical; | |
} | |
// Universal heading rendering | |
// Remove all margins from Headings | |
h1, | |
h2, | |
h3, | |
h4, | |
h5 { | |
-webkit-font-feature-settings: 'kern' 1; | |
font-feature-settings: 'kern' 1; | |
margin: 0; | |
} | |
// Remove list styles on ul, ol elements with a class attribute | |
ul[class], | |
ol[class] { | |
list-style: none; | |
padding-left: 0; | |
} | |
// Make images easier to work with | |
img { | |
max-width: 100%; | |
display: block; | |
} | |
// Inherit fonts for inputs and buttons | |
input, | |
button, | |
textarea, | |
select { | |
font: inherit; | |
} | |
// Remove all animations and transitions for people that prefer not to see them | |
@media (prefers-reduced-motion: reduce) { | |
* { | |
animation-duration: 0.01ms !important; | |
animation-iteration-count: 1 !important; | |
transition-duration: 0.01ms !important; | |
scroll-behavior: auto !important; | |
} | |
} | |
// ========================================================================== | |
// Base styles: Inline Text Treatments | |
// ========================================================================== | |
// Marked Text | |
mark { | |
background: var(--color-yellow); | |
} | |
// Highlighting & Selection | |
::-moz-selection { | |
background: var(--color-yellow); | |
text-shadow: none; | |
} | |
::selection { | |
background: var(--color-yellow); | |
text-shadow: none; | |
} | |
// Remove color and text-decoration from links with a class | |
a[class] { | |
text-decoration: inherit; | |
color: inherit; | |
} | |
// Links without a class get default styles | |
a:not([class]) { | |
text-decoration-skip-ink: auto; | |
text-decoration-color: blue; | |
text-decoration-thickness: 1px; | |
&:hover, | |
&:active { | |
color: red; | |
text-decoration-color: red; | |
} | |
&:visited { | |
color: red; | |
text-decoration-color: none; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment