Skip to content

Instantly share code, notes, and snippets.

@robby1066
Created February 3, 2021 23:47
Show Gist options
  • Save robby1066/2fde8c20185e0246ba1a43d60cbe94f5 to your computer and use it in GitHub Desktop.
Save robby1066/2fde8c20185e0246ba1a43d60cbe94f5 to your computer and use it in GitHub Desktop.
CSS boilerplate structure that prioritizes user preferences
/* VARIABLES */
/* SASS VARIABLES - WILL BE PREPROCESSED */
$mobile-breakpoint: 768px;
/* CSS VARIABLES - WILL BE RENDERED IN BROWSER */
:root {
/* COLORS */
/* --example-color: #000000; */
/* FONT SIZES */
/* --example-size: 1.5rem; */
}
/* PREFERS DARK MODE */
/* Does this design accomodate viewers who prefer a dark color scheme? */
@media(prefers-color-scheme: dark) {
:root {
}
}
/* PREFERS REDUCED MOTION */
/* Does this design accomodate viewers who prefer reduced motion? */
@media (prefers-reduced-motion) {
:root {
}
}
/* GLOBAL STYLES */
:root {
}
/* DESKTOP-ONLY STYLES */
@media only screen and (min-width: ($mobile-breakpoint+1px)) {
:root {
}
}
/* MOBILE-ONLY STYLES */
/* Does this design accomodate viewers using a small screen or screen magnifier? */
@media only screen and (max-width: $mobile-breakpoint) {
:root {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment