Reputation: 1409
I have a asp.net page this asp.net page changes color based on the application area there are 5 application area's each application area has its own color .
I need to change the color of the page based on the application area selected. I need to use lesscss and reuse existing css to change the color .
Is it possible to call a less css class from the html passing it the color based on the applciation area . Or any other way ?
How do i go about this ?
Upvotes: 0
Views: 94
Reputation: 3203
You can create one less file that will define all your base styles that are dependent on color parameter and then, for each site area create a separate less file that will override the color and import the base file. You'll get a separate styles file for each area:
styles.less:
// Define default color value
@color: blue;
.foo {
color: @color;
}
red-styles.less:
// import base classes
@import "relative-path-to-base-styles\styles.less";
// override default value for color
@color: red;
Upvotes: 1