0

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 ?

1
  • 1
    You would probably have to create different classes (either by hand-coding or using mixins) and then use them like here. Commented Jul 30, 2014 at 8:29

1 Answer 1

1

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;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.