Skip to content

Perform Math on Other Attributes? #605

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

Closed
jonahbron opened this issue Jan 31, 2012 · 2 comments
Closed

Perform Math on Other Attributes? #605

jonahbron opened this issue Jan 31, 2012 · 2 comments

Comments

@jonahbron
Copy link

Is it possible to perform math on another attribute in a declaration? For example...

padding-top: 4px;
height: 100px - @padding-top

Or do I need to explicitly define a variable and use it in both locations?

@Synchro
Copy link
Member

Synchro commented Mar 23, 2012

LESS' parser is deliberately simple and it doesn't keep track of things like that, so you need to do the latter. It would also result in a large number of reserved words, so you wouldn't be able to do this:

@padding-top: 4px;
padding-top: @padding-top;

@lukeapage
Copy link
Member

as @Synchro said. Also bug #76 is a request for accessors (so this is a duplicate)

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

No branches or pull requests

3 participants