Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variables in import paths only work if defined in same file #1846

Closed
ESchuderer opened this issue Feb 3, 2014 · 8 comments
Closed

variables in import paths only work if defined in same file #1846

ESchuderer opened this issue Feb 3, 2014 · 8 comments

Comments

@ESchuderer
Copy link

LESS v 1.6.2

Test Case

variables.less

@theme: 'default';

buttons.less

@import 'variables.less';

some button related less code

@import 'themes/@{theme}/buttons.less';
Error
variable @theme is undefined
Workaround

If I define the @theme variable directly within the buttons.less file it works fine, but if I do in the imported variables.less it wont work. Any other variables outside of that @import section work fine, eg. padding: @size-xs @size-s;.

@seven-phases-max
Copy link
Member

Yep, known issue http://lesscss.org/features/#variables-feature-urls.

@lukeapage
Copy link
Member

There are other dupes of this issue too

@matthew-dean
Copy link
Member

Blarg, I just ran into this one on my current project.

@chrylis
Copy link

chrylis commented Oct 22, 2014

I'd like to add a +1 for this. I have some rather unwieldy relative paths for Bootstrap components, and absent a merge on #1965, this would help clean things up markedly.

@lukeapage
Copy link
Member

I'll look at this, I have a plan to improve things

@lukeapage
Copy link
Member

@chrylis would you be able to try out #2246 and see if it fixes your problem?
Any testing would be appreciated.

@chrylis
Copy link

chrylis commented Oct 26, 2014

@lukeapage I'm brand-new to managing a JS/CSS build, and I'm not sure how to run a version of a JavaScript application out of a PR. Using Mimosa, if that matters.

@lukeapage
Copy link
Member

I think you would have to wait till mimosa less gets updated and a stable version is released.

https://github.com/dbashford/mimosa-less/blob/master/package.json

I've put the changes into v2, which is released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants