4

In my application I must add feature for the user to chnage UI colors.

For this purpose I have created .less file and set some global variables to their default value.

What is the best practice for creating theme in Asp.net MVC?

3
  • Will the user be able to select a specific color? Or will a colorscheme be sufficient aswell? Commented Jun 1, 2015 at 13:50
  • @Mark Colorscheme is sufficeint Commented Jun 1, 2015 at 13:51
  • Less is a preprocessor, its variables do not exist by the time a page is rendered. Commented Jun 1, 2015 at 13:57

1 Answer 1

2

I would create a base styling for the default styling and different stylesheets (less files and finally seperate .css files) for each colorscheme, each scheme overrides the colors in the base file, then dynamically load the stylesheet according to your business logic using javascript

Dynamically loading css stylesheets

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the answer. I will do go with that way.

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.