Suppose I have an application with multiple instalations that share the same CSS schema. Each of these applications would have the same CSS files with differente colors.
I'm thinking of the following solution:
- Instead of referencing real colors, I'd reference <%variable names%> inside the CSS files. These CSS files, as already mentioned, would be the same for all installations of the application.
- Each of the instalations of the same applications would have a table that relates the variable names with the actual colors inst开发者_开发知识库ead of the whole CSSs.
- The application would refer to the CSS files using a ASHX (generic HTTP handler), that would compile the CSS and return it.
- It's preferable if these color tables could be edited by a visual software.
Is this already implemented somewhere?
Maybe http://www.dotlesscss.com/ can be helpful. Other than that, using asp.net themes can also give you some of the required flexibility.
It can be done in 3 easy steps:
- Install Ruby: http://www.ruby-lang.org/en/downloads/
Install HAML (a faster way of writing HTML - kind of like unopened Zen Coding) in your command line/powershell using:
gem install haml
Now in the cmd line do:
sass --watch folderWithSass:compileMyCSSToThisFolder
See: http://nex-3.com/posts/90-auto-compile-sass-files-with-sass-2-4 for full details.
Also... I recommend checking out CSS Tricks for an example of how to write in SASS - http://css-tricks.com/video-screencasts/88-intro-to-compass-sass/
精彩评论