Last active
January 30, 2016 21:22
-
-
Save jestho/c30b9b8add95b94e729e to your computer and use it in GitHub Desktop.
Function for determining important selectors. Nice for frameworks.
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 (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