I would like to allow administrators to be able to simply modify the theme of their own website. I certainly don't know what the ideal approach would be, but my naive concept of how to do it is like this:

  • Create a theme.css file that is dynamically generated, and overloads the colors and background images of the main css of the site. No sizes or positions get changed.
  • Allow users to select different named css colors, from the full css spec for named colors, e.g. darkred, crimson, chartreuse, chocolate, etc.
  • Allow user to select different images to certain appropriate-for-theming background images.
  • Replace the default colors set in theme.css with the user preferred colors, and the default background images with the user specified background images.
  • Serve the dynamically created theme.css file.

So that's my naive idea of how to do it. Are there better, less breakable tools & techniques out there for admin user theming that I should look into instead?

1 answer

danwellman 5600

jQuery UI has a very powerful theme generator, which generates the images you need and the stylesheet for you, and there is a theme-switcher plugin that allows you to easily change themes dynamically, could be just what you need. All you'd have to do would be to host all the different themes you want your users to be able to use somewhere on your site...

The themeimg is handled using classes so if you don't want to use jQuery, you could implement your own theme switcher and just use the CSS framework aspect of jQuery UI

Answered almost 9 years ago by danwellman