Yes, this is an option I'm evaluating.
My goal is to have an html+css template that is visibile from any HTML+CSS browser and then add "configurability" to it by using javascript.
I don't think Less can help with this: e.g: if I don't run javascript the style is not applied. Instead I would like to have a system where I can declare the style in standard stylesheet and then have some declaration to override it via forms (bound with KO, like I already do with html content/attributes).
As I wrote in the first post, my requirement is to write something like this in the HTML:
<style>
selector { property: /* ko text: variable */defaultValue/* /ko */; }
selector2 { property2: /* ko text: variable2 */defaultValue2/* /ko */; }
/* ko if: variable3 */
selector3 { property3: value3; }
/* /ko */
</style>
I can use a different syntax for comments, but I have to implement something similar.
One of my option is to read the style content, replace /* with <!-- and */ with -->, translate it into a KO template and then get the output of the template and replace back <!-- with /* and --> with */. but i fear this would kill the browser for performances (but maybe i'll try)