Skip to content

Instantly share code, notes, and snippets.

@napotopia
Last active August 23, 2021 14:17
Show Gist options
  • Save napotopia/354dda6501854380f9b4c49f49db19ce to your computer and use it in GitHub Desktop.
Save napotopia/354dda6501854380f9b4c49f49db19ce to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
$bg-color: pink !default;
$body-color: gray !default;
// default theme here
:root {
--background-color: #{$bg-color};
--body-color: #{$body-color};
}
div {
padding: 0.5rem;
border: 1px solid black;
margin-bottom: 1rem;
background-color: var(--background-color);
color: var(--body-color);
}
div.alternate {
--background-color: red;
background-color: var(--background-color);
}
// custom theme here
:root {
--background-color: purple;
--body-color: white;
}
<div>div that is not red</div>
<div class="alternate">div that is red</div>
:root {
--background-color: pink;
--body-color: gray;
}
div {
padding: 0.5rem;
border: 1px solid black;
margin-bottom: 1rem;
background-color: var(--background-color);
color: var(--body-color);
}
div.alternate {
--background-color: red;
background-color: var(--background-color);
}
:root {
--background-color: purple;
--body-color: white;
}
{
"sass": {
"compiler": "dart-sass/1.32.12",
"extensions": {},
"syntax": "SCSS",
"outputStyle": "expanded"
},
"autoprefixer": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment