Last active
March 1, 2023 16:31
-
-
Save sgregson/3efbe08ae1644be7016e6d46dc61b1f0 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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
// vars are implied/provided globally | |
$font-size-1000: 10px; | |
/** before*/ | |
.node { | |
someProp: $font-size-1000 | |
} | |
/** | |
* after codemod | |
* 1. inject media query | |
* 2. assign responsive values | |
* 3. reassign variable | |
*/ | |
@media (max-width: 480px) { // (1) | |
:root { | |
--font-size-1000: 50px; // (2) | |
} | |
} | |
$font-size-1000: var(--font-size-1000, $font-size-1000); // (3) | |
.node { | |
someProp: $font-size-1000 | |
} |
This file contains 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
/** before*/ | |
.node { | |
someProp: 10px; | |
} | |
/** | |
* after codemod | |
* 1. inject media query | |
* 2. assign responsive values | |
* 3. reassign variable | |
*/ | |
@media (max-width: 480px) { | |
:root { | |
--font-size-1000: 50px; | |
} | |
} | |
.node { | |
someProp: var(--font-size-1000, 10px); | |
} |
This file contains 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