In sass, the way one imports is by using the import command. I will use Zurb Foundation as an example:
@import "foundation";
This will then import the whole foundation.scss
file and all it's relative imports to the top of the current file. This means that the entire foundation.scss
file will be compiled and outputted along with the contents of the file to the final <name here>.css
file.
Though this is good for customisation, such as custom colors and spacing, it becomes a pain when creating libraries and distributing these libraries as individual droplets for other people to slot into their existing projects.
Is there a way to import files as "references", so that mixins
and other variables become available in the scope of the current file, but other css statements are ignored? The LESS css preprocessor has a newly implemented import tag similar to this (appropriately named a reference
).