less.ruby icon indicating copy to clipboard operation
less.ruby copied to clipboard

Mixins and Variables available globally (throughout @imports)

Open timkelty opened this issue 16 years ago • 5 comments

Currently I have to maintain a constants.less file and @import it into the top of each of my files to get the variables I need available (reset.less, screen.less, forms.less etc). Less than ideal, and if I'm using with mixins, it results in duplicate code in the output.

Ideally, I'd be able to import my constants.less file at the top of my reset, and import reset and forms a the top of my screen.less and all the vars and mixins from the constants.less would still be available.

I'm using Less daily on every project now, and this along with issue 62: http://github.com/cloudhead/less/issues/#issue/62 would take any frustration out of it!

timkelty avatar Nov 19 '09 20:11 timkelty

i second this, i have a somewhat big less library and it is getting really slow on compile, i think this is because i import like 20 times the same files.

mechanicalchopsticks avatar Nov 30 '09 21:11 mechanicalchopsticks

Am I wrong, or has this been fixed with the latest build? Seems to be for me.

timkelty avatar Jan 19 '10 18:01 timkelty

I was wrong, this is still an issue

timkelty avatar Jan 25 '10 16:01 timkelty

Yeah, and what i need is vars and mixins to bleed; so for example, screen.less imports mixins.less and forms.less; and have mixins available in forms.less

mechanicalchopsticks avatar Jan 26 '10 19:01 mechanicalchopsticks

What I've discovered is as long as you chain things together variables and mixins are available.

So screen imports forms, forms imports mixins, mixins imports contants, contants imports reset, etc.

A little silly, but it works.

timkelty avatar Jan 26 '10 21:01 timkelty