less.js icon indicating copy to clipboard operation
less.js copied to clipboard

get Attribute from other class

Open paxos opened this issue 14 years ago • 5 comments

Am I stupid, or is this just not possible with LESS?

page {

widht: 1000px; }

content {

width: #page.width - 300; }

Would be so awesome useful, so I am writing this a feature request here.

paxos avatar Jul 05 '12 11:07 paxos

Why not just use variables?

@pagewidth: 1000px;

#page { width: @pagewidth; }

#content { width: @pagewidth - 300; }

MokoJumbie avatar Jul 05 '12 13:07 MokoJumbie

Possible Overhead in Big-Projects

paxos avatar Jul 05 '12 13:07 paxos

I guess I can't imagine a scenario where it wouldn't be manageable. Not to say it won't happen, but I'd love to see a use case where use of variables wouldn't be suitable.

MokoJumbie avatar Jul 05 '12 14:07 MokoJumbie

-1

If you can't use variables in your project than you are using less wrong way.

Your team must learn that refactoring css gives company big profit in long run.

nexik avatar Jul 05 '12 21:07 nexik

@MokoJumbie's approach is the "correct" LESS approach. You can't reference a property value in that way.

matthew-dean avatar Jul 19 '12 19:07 matthew-dean