Change a webpage theme

I know that this is nowhere related to the issue of coding, but before I start working on the script, I would like to get some recommendations.

The script should provide an opportunity to change the theme of the page. What I have decided is to give a general class for several elements, such as

  • h1 tag for all main page titles
  • .image class for all page images
  • class for p tag for page content
  • etc.

So, I will create some style sheets with these class names with different colors.

But the difficulty is associated with the positioning of each element. I tried to give an inline style to each element in order to identify things related to the position. for instance

.image {border:grey solid 1px /*this border color will be different in each stylesheet*/} <div class="image" style="float:right; margin:6px"><img src="" /> </div> 

Thus, all other elements will have built-in css to align the target.

Do you think this is the best way to achieve a thematic scenario?

PS - The user has access to customize the theme. (We provide an editing panel). This is not a web page, this is a product module (just like we change the color of Powepont charts and graphs).

+6
source share
2 answers

Not really ... I think you should download the standard "empty" theme for basic styles and general styles. Then load another stylesheet depending on the theme you choose. In this topic, you specify theme-specific styles (for example, the border color from your example).

+3
source

You can use LESS or SaSS .

LESS works both on the server side and on the client side

0
source

All Articles