Created
February 3, 2021 23:47
-
-
Save robby1066/2fde8c20185e0246ba1a43d60cbe94f5 to your computer and use it in GitHub Desktop.
CSS boilerplate structure that prioritizes user preferences
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
/* 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