1

Example I have exist class like

.color-white {
   color : #fff;
   //background: #fff; <-- or getting by background
}

It could be located in third-party .css file.

And in Less how to get color #fff ?

Somthing like

.hello {
   color : getColorByClass(.color-white);
}

or

@white : getColorByClass(.color-white);

Is it possible?

divibisan
  • 11,659
  • 11
  • 40
  • 58
l2aelba
  • 21,591
  • 22
  • 102
  • 138

1 Answers1

1

So to not leave this unanswered. The answer is "No, it's impossible".

Simply because the primary purpose of Less is to help to write a new and not to hack an existing CSS code.


Technically, there're some features planned that will make this possible (more like a side-effect rather than a primarily aim again). But yet again, w/o knowing what your actual goal was and what kind of problem you tried to solve, it's difficult to say if such feature would be a proper way to solve it (suspecting an XY-Problem as always).

seven-phases-max
  • 11,765
  • 1
  • 45
  • 57