Created
March 7, 2024 17:05
-
-
Save silouanwright/13c4549288cfd52007866574ccde8e47 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// Define SCSS variables with default values | |
$header-color: purple; | |
$font-size: 16px; | |
// Create CSS custom properties with the same names and default values | |
:root { | |
--header-color: #{$header-color}; | |
--font-size: #{$font-size}; | |
} | |
// Global class selector | |
.brand-2024 { | |
// Redefine CSS custom properties with desired values | |
--header-color: red; | |
--font-size: 18px; | |
} | |
// Use CSS custom properties in your styles | |
h1 { | |
color: var(--header-color); | |
font-size: var(--font-size); | |
} |
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
<div class="brand-2024"> | |
<h1>Hello Joe!</h1> | |
</div | |
> |
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
:root { | |
--header-color: purple; | |
--font-size: 16px; | |
} | |
.brand-2024 { | |
--header-color: red; | |
--font-size: 18px; | |
} | |
h1 { | |
color: var(--header-color); | |
font-size: var(--font-size); | |
} |
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
{ | |
"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