开发者

Application Theming

I'm designing an application that'd require diff开发者_Go百科erent themes. By 'theme' I mean the colors and logo. Is using jQuery themeroller the only option or is there any easier solution to generate themes by providing colors and images?

Thanks


A simple solution is to give the body (or a div that wraps everything) a css class to indicate the theme.

Then you can specify colours and background images based on theme class.

For example

.theme1 .thingy { color: #eee; }
.theme2 .thingy { color: red; }

You could put theme1 and theme2 definitions in separate files if you so wish.

Doing it this way means the theme can be swapped using client-side javascript just by changing the body's class.


Themeroller is just a way to customize specific classes. The jQueryUI widgets use pre-defined classes. Themeroller themes just define those classes. You can just as easily develop a second stylesheet for your application, that re-defines the classes you've used.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜