Reputation: 712
Here's my CSS:
div {
border: 0;
display: block;
width: 100%;
height: width * 1.26411765;
}
I'd like "width" to be the current pixel width of the element. Does that make sense? Is this possible?
Upvotes: 0
Views: 135
Reputation: 52588
Use something like
div {
border: 0;
display: block;
width: @div-width;
height: (@div-width * 1.26411765);
}
See: http://lesscss.org/#-operations
EDIT: Having just read your question properly (oops) you can access javascript from less to get values. See the link above and scroll further down the page. I've never actually tried it though.
Upvotes: 1