-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Accessors #6
Comments
I've decided to scrap accessors, at least for the first version. It turns out they aren't all that useful.. |
@cloudhead: That's a shame, I could really see potential for "OO" organization in them (Issue #564). I assume we have to wait at least till version 2 now? |
@cloudhead: I've been google searching for days too see if this was possible with LESS. Is there a chance of it in the future? On a complex site I could be looking at all kinds of variables and it'd be great to be able to organize them inside mixins and be able to access them from other sources. vars.less: .colors() { @blue: #234; @red: #b3452; etc... } .grid() { @col-width: 5em; @col-gutter: 1em; } main.less: @import "vars"; .alert { width: .grid[@col-width] * 12; margin: 0 (.grid[@col-gutter]/2) 0 (.grid[@col-gutter]/2) color: .colors[@red]; background: lighten(.colors[@red], 50%); } This would be INSANELY helpful. Is there hope? |
@mindfullsilence: |
Fixed, thanks for pointing it out. I guess it's not that big of a deal, I can always seperate variables in my stylesheet with comments. But I have a few frameworks I've built and I like to use pieces from each one on occassion. So I prepend each variable with the name of my framework. It'd save a lot of time building these frameworks out if I could do something like this: fw-1.less: .fw-1_colors() { @red: #2345ba; @blue: #928342; } fw-2.less: fw-2_colors() { @red: #239401; @blue: #293872; } Without this option, I end up prefixing every variable I have: @fw-1-colors_red: #2345ba; @fw-2-colors_red: #239401; @fw-1-colors_blue: #928342; @fw-2-colors_blue: #293872; Some of my frameworks do as much as the twitter bootstrap, and end up having a LOT of variables. Be a lot easier to write these frameworks if I could just set them inside of a wrapping mixin. |
have you tried
I'd like to hear from @cloudhead whether this is a feature or a bug though (it could cause collisions if your using functions written by someone else) |
From the original less.rb tests, this test doesn't pass.
it fails on the
[
The text was updated successfully, but these errors were encountered: