I have a partial sass file which holds mixins that I would like to access globally. My understanding is that all you need to do is @import this file into a master.scss file and it should be accessible globally. Sadly this isn't the case for me. I need to import the variable file into every individual .scss file I want to use it in. What do I nee to do to get so that importing it to the master.scss file I can access my mixins globally?
This is a rails app with my master.scss file imported into the application.scss file.
My assets tree
- scss
-- utilities
-- _mixins.scss
-- components
-- buttons.scss
master.scss
Contents of my master.scss file
@import 'utilities/_mixins';
@import 'components/buttons';
Contents of my mixins.scss file
@mixin square-size($size) {
height: $size;
width: $size;
}
Example of how I'm using the mixin in components/buttons.scss:
.square-button {
@include square-size(40px);
}