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

add the variable env to css scope #1135

Closed
kadkaz opened this issue Jan 21, 2013 · 3 comments
Closed

add the variable env to css scope #1135

kadkaz opened this issue Jan 21, 2013 · 3 comments

Comments

@kadkaz
Copy link

kadkaz commented Jan 21, 2013

For some styles to apply I need to know is it prod or test execution.

Real scenario:
right now I necessary to have to files
index.css
indextest.css

with @mode = normal
and @mode = test

.rotate(test, @Angle) {
//nothing
}

.rotate(normal, @Angle) {
content: @mode;
-moz-transform: rotate(@Angle);
-webkit-transform: rotate(@Angle);
-o-transform: rotate(@Angle);
}

.rotate(@Angle) {
.rotate(@mode, @Angle);
}

and there is another hack for auto selenium testing, cause FF transforms bad (DOM disappeared and selenium could not find it)

But I hope the real scenario does not scary you and it can be useful for any other scenario.

and it will be great to have the variables from request too, not only from script.
I mean:
script src="js/less.js?env=test" type="text/javascript"></script

@lukeapage
Copy link
Member

is this relevant for how to pass variables to a script... #1131

then you can use mixin guards (http://lesscss.org/#-pattern-matching-and-guard-expressions) to change which mixins get used (or use the variables directly in content).

when posting code, use a tab/4 spaces indentation in order to tell guthub its code. Or use backticks around code. Then you won't notify @angle and @mode

@jonschlinkert
Copy link
Contributor

Could this be accomplished with #1134?

@matthew-dean
Copy link
Member

@jonschlinkert I agree, switching testing / dev modes is better handled via options (whether it ends up being a config file or within the library).

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

4 participants