problem : i have to allow users to have different colors for buttons , icons , text color as per their preference using spectrum.js
i have tried to solve this using dotless for that i created a file .less and added all values. now issue is that i have to get values from databased based on loggedInuser and have to dynamically change
@back-color: blue;
@font-color: red;
to different values and this has to be done run time not compile time. i know it will cost me some delay but i dont know how to solve it other wise.
i have been thinking of different solution rather to have a less file why not on saving time i create a css file save in database and when user gets logged in create a css file and inject in to header
<link href="~/Content/dynamic.css" rel="stylesheet" />
can some one help me or any suggestion regarding this??
any help will be appreciated
Option 1 Implement special handler for resource, that represent css customized by user. This handler must:
You also should remove/update cache entry when user changes his color theme. You can implement cache as you wish: in memory, inside database or inside static files that named (for example) like %userId%.css.
Option 2 Instead of render less on server side (and consume server resources) you can render less on client dynamically. Exmaple: http://jsbin.com/wiqosutexe/5/edit?html,js,output