-
-
Save jonnybojangles/5920859 to your computer and use it in GitHub Desktop.
I place this function atop my main/primary SASS file for all modules with in a site or project. When multiple modules are combined in a layout the main/primary styles are not duplicated each time. Thanks to user courtsimas and !default http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variable_defaults_
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
$imported-once-files: () !default; | |
@function import-once($name) { | |
@if index($imported-once-files, $name) { | |
@return false; | |
} | |
$imported-once-files: append($imported-once-files, $name); | |
@return true; | |
} | |
@if import-once("_style.scss"){ | |
//base styles and declarations of cool sass-iness that you only want included once | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment