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
  • 10,372
  • 11
  • 36
  • 56
l2aelba
  • 20,261
  • 20
  • 97
  • 133

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,612
  • 1
  • 43
  • 57