Last active
August 6, 2023 10:05
-
-
Save glen-cheney/499c8f270324ef7e5ca0 to your computer and use it in GitHub Desktop.
How to overwrite global variables in Sass.
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
// Use `!global` when assigning it. | |
$day: "Monday :("; | |
@mixin update-day() { | |
$day: "Friday!" !global; | |
}; | |
.today { | |
@include update-day(); | |
day: $day; | |
} |
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
.today { | |
day: "Friday!"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That
!global
is really handy!