开发者

Is there a library/tool to manage themeable CSS for ASP.NET applications?

开发者 https://www.devze.com 2023-01-07 21:35 出处:网络
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.

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:

  1. 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.
  2. 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.
  3. The application would refer to the CSS files using a ASHX (generic HTTP handler), that would compile the CSS and return it.
  4. 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:

  1. Install Ruby: http://www.ruby-lang.org/en/downloads/
  2. Install HAML (a faster way of writing HTML - kind of like unopened Zen Coding) in your command line/powershell using:

    gem install haml

  3. 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/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号