dfreeman / ember-css-modules-sass

An ember-css-modules plugin that configures the build pipeline for use with Sass
MIT License
17 stars 5 forks source link

Global mixins #2

Open dan-ste opened 7 years ago

dan-ste commented 7 years ago

Hi, how can I use mixins which have been declared globally?

dfreeman commented 6 years ago

Hi @Dan-Ste — can you provide more details about what you're aiming to do? What have you tried that's not working as you'd expect?

dan-ste commented 6 years ago

I want to store all my mixins in one file and get access to them from any part of my scss code. And variables also)

piotrpalek commented 6 years ago

The variables part is also something I'd want to do. For eg. have a colors.sass file somewhere with colors defined as $color1: #FFF and then reference this color in a CSS module.

dfreeman commented 6 years ago

@Dan-Ste By the time the Sass compiler sees your code, it will all have been concatenated into a single big file, so the only thing you should need to do is make sure that your shared mixins/variables wind up near the top of that file so you can reference them.

Take a look at the headerModules configuration option for ember-css-modules; it should allow you to do what you need to.

lolmaus commented 5 years ago

Ran into this issue too. This should be in the readme!

dfreeman commented 5 years ago

@lolmaus PRs welcome 😉