Hi All,
We have a RAD tool that generates HTML, CSS, and JavaScript based on SQL
statements. The tool generates MANY predefined CSS class names attached to
the HTML. For example:
<button type="button" class="Edit-Button" > Edit </button>
We already have and want to retain the ability to attach various themes and
look and feels based on user requirements. I don't really want to change
the generation of the css in the tool although that is an option.
So for example, if I want this to be a BOOTSTRAP responsive theme, I want
this button to be generated with BOOTSTRAP class of .btn-primary. If it's
a JQuery, then the target class name may be different.
After giving it some thought, I really want the ability to MAP a CSS class
to another. My thought is to use LESS as described here:
https://www.gaslampmedia.com/mapping-css-styles-less/
So for each various theme I wanted, I would include a .LESS/CSS that maps
the classes to a target class. In my example above the CSS/LESS would look
like this:
.Edit-Button {
.btn,
.btn-primary
}
This will override the class style “Edit-Button” and replace it with
Bootstrap. My question is, has anyone done this? Is there a better design
approach?
Thanks in advance, Paul Holm
As an Amazon Associate we earn from qualifying purchases.