Skip to content

Instantly share code, notes, and snippets.

@Vestride
Last active August 6, 2023 10:05
Show Gist options
  • Save Vestride/499c8f270324ef7e5ca0 to your computer and use it in GitHub Desktop.
Save Vestride/499c8f270324ef7e5ca0 to your computer and use it in GitHub Desktop.
How to overwrite global variables in Sass.
// Use `!global` when assigning it.
$day: "Monday :(";
@mixin update-day() {
$day: "Friday!" !global;
};
.today {
@include update-day();
day: $day;
}
.today {
day: "Friday!";
}
@movahhedi
Copy link

That !global is really handy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment