Created
October 15, 2015 08:15
-
-
Save Hwangss/b2d4cd78bd1ba4da6323 to your computer and use it in GitHub Desktop.
Sass 'require' Solution
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-modules : () !default; | |
// The cache has been introduced to ensure that no duplicate references are guaranteed. | |
// @param {String} $name - Name of exported module. | |
// Recommended content and file name as same, if you want to import a file. | |
// for example : @inculde export('_reset') { @import '_reset'; } | |
@mixin export($name) { | |
@if (index($imported-modules, $name) == null) { | |
$imported-modules: append($imported-modules, $name) !global; | |
@content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment