Skip to content

Instantly share code, notes, and snippets.

@robwierzbowski
Last active November 2, 2017 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robwierzbowski/cd2e77ad1062699d1aa9033ae6d93660 to your computer and use it in GitHub Desktop.
Save robwierzbowski/cd2e77ad1062699d1aa9033ae6d93660 to your computer and use it in GitHub Desktop.
Set stylesheet example. Uses PostCSS nesting and simple variables.
/*
Set default element styles
Based partially on sanitize.css v2.0.0
github.com/jonathantneal/sanitize.css
*/
*,
::before,
::after {
box-sizing: border-box;
}
:root {
font-size: 112.5%; /* 18px */
line-height: 1.45;
font-synthesis: none; /* disable browser-created font variants */
}
::selection {
color: white;
text-shadow: none;
background-color: $purple-desat;
}
html {
font-family: $serif-initial-family;
color: $off-black;
background-color: white;
&.-fontsLoaded {
font-family: $serif-family;
}
}
body {
margin: 0;
/* Global type enhancements */
font-variant-ligatures: common-ligatures contextual;
}
audio,
canvas,
iframe,
img,
svg,
video {
vertical-align: middle;
}
img {
display: block;
}
button,
[type="button"],
[type="date"],
[type="datetime"],
[type="datetime-local"],
[type="email"],
[type="month"],
[type="number"],
[type="password"],
[type="reset"],
[type="search"],
[type="submit"],
[type="tel"],
[type="text"],
[type="time"],
[type="url"],
[type="week"],
select,
textarea {
min-height: 1.4em;
}
textarea {
overflow: auto;
vertical-align: top;
resize: vertical;
}
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
[aria-busy="true"] {
cursor: progress;
}
[aria-controls] {
cursor: pointer;
}
[aria-disabled] {
cursor: default;
}
code,
kbd,
pre,
samp {
font-family: $monospace-family;
}
/* Set sub, sup without affecting line-height: gist.github.com/413930 */
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment