Objective / Purpose
I am working with multiple div elements and I want to assign two distinct classes to each of them, each serving a different purpose within my application.
One class should determine the level, influencing the color of the div. The other class should indicate distance and adjust the opacity of the background accordingly.
As a result, I envision the div looking like this:
<div class="element level-beginner distance-long">
This configuration would ideally display a green background that is somewhat faded.
I have some knowledge about LESS, although limited, and believe that nested styles could be beneficial in this scenario (as it pertains to applying specific properties based on existing class assignments).
In essence, I aim to manage color and opacity/fade as separate CSS classes that operate independently from one another.
Inquiry
- Is there a method in LESS that allows a class to control the alpha/fade of a div element's background without explicitly specifying the color?