Skip to content

Instantly share code, notes, and snippets.

@jestho
Last active January 30, 2016 21:22
Show Gist options
  • Save jestho/c30b9b8add95b94e729e to your computer and use it in GitHub Desktop.
Save jestho/c30b9b8add95b94e729e to your computer and use it in GitHub Desktop.
Function for determining important selectors. Nice for frameworks.
// ----
// Sass (v3.4.12)
// ----
@function _important() {
$apply-importants: true !default;
@return if($apply-importants, !important, null);
}
// Some file
.primary {
color: #ff0000 _important();
}
// Some other file
$apply-importants: false;
.secondary {
color: #00ff00 _important();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment