Skip to content

Instantly share code, notes, and snippets.

@Hwangss
Created October 15, 2015 08:15
Show Gist options
  • Save Hwangss/b2d4cd78bd1ba4da6323 to your computer and use it in GitHub Desktop.
Save Hwangss/b2d4cd78bd1ba4da6323 to your computer and use it in GitHub Desktop.
Sass 'require' Solution
$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