CSS Editor

Mantaining multiple CSS based on different color schemes
Download

CSS Editor Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Publisher Name:
  • Alberto Venditti
  • Publisher web site:
  • http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=457113
  • Operating Systems:
  • Windows All
  • File Size:
  • 79 KB

CSS Editor Tags


CSS Editor Description

In the web application development, it's usual to face the need to make the user able to customize the layout and appearance of a web site based on his own color preferences. A simple way to accomplish this feature is through the adoption of different, customizable, Cascading Style Sheet (CSS) files associated to each user: in this way, the user can manipulate or upload his own CSS file in order to see the web pages rendered based on the particular chosen color scheme. In this scenario , you may need to mantain multiple CSS files, all similar in the structure but different in the choices made in terms of colors used; and this kind of maintenance can become hard and tedious as the number of CSS grows. For example, if you need to add or modify a class in your "master" CSS, you will have to update all the customized CSS files in the same way, editing each of them to operate the addition/modification of the same CSS class, but preserving the user's color choice. Mantaining multiple CSS files becomes tedious also when you have the same color palette used in a lot of different CSS files, you decide to change one or more colors of the palette and you need to update all the existing CSS files substituting just the changed color(s) in each style sheet . The CSSeditor application was based upon a very simple idea: to have a CSS file that acts as a "master" (or, if you prefer, as a template) for the automatic generation of another CSS file, that is different from the template only in the color scheme (or palette) used. So, you can look at a CSS file generated by CSSeditor as a "sum" of a CSS template "plus" an applied color palette. With this idea in mind, it's simple to imagine a solution for both the situations previously depicted: - for the first one, , you can regenerate the user's custom CSS files by applying different user's color palettes (extracted by their own original CSS files) to a new, modified CSS template; - for the second one, , you can recreate the different CSS files by applying the new, modified color palette to each original CSS file (used as a template). Basically, the only "problem" about this automatic CSS generation consists in isolating the customizable color elements of the CSS template. Once they are isolated, their substitution with a new set of colors is just a matter of find&replace.


CSS Editor Related Software