ember-css-modules-sass icon indicating copy to clipboard operation
ember-css-modules-sass copied to clipboard

Global mixins

Open dan-ste opened this issue 7 years ago • 6 comments

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

dan-ste avatar Oct 22 '17 11:10 dan-ste

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?

dfreeman avatar Nov 10 '17 20:11 dfreeman

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)

dan-ste avatar Nov 12 '17 21:11 dan-ste

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.

piotrpalek avatar Nov 27 '17 13:11 piotrpalek

@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.

dfreeman avatar Nov 30 '17 18:11 dfreeman

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

lolmaus avatar Sep 02 '19 13:09 lolmaus

@lolmaus PRs welcome 😉

dfreeman avatar Sep 03 '19 11:09 dfreeman