tags:

views:

88

answers:

1

I have been using themes for a while, and off late when I was trying to refactor my code, a thought came to mind. My theme is always split into two pieces, one that guides the basic layout issues, and the other that guides the colors, images, etc. Everytime, we have to design for a new client, we switch the themes, and we are done. However, the hidden issue here is that we have to make a copy of the layout css in every theme. A typical example of my themes folder would be : App_Themes - Default - LayoutCSS - ColorCSS - Images - Client1 - LayoutCSS - ColorCSS_Client1 - Images - Client2 - LayoutCSS - ColorCSS_Client2 - Images

If you notice, the LayoutCSS is being repeated in all the themes. One simple way to eliminate the duplication is to remove it from App_Themes and put it in a separate folder, and reference it from the masterpage(s). The downside to that approach is that, I have to manually reference the style in every page I use (that does not use masterpages).

Now, the question is....is there anyway I can have a global theme that applies for all my pages, and a local theme that is controlled from my web.config (like regular themes).And both of them behave in sync.

Thanks,

Sashidhar Kokku

+1  A: 

you could place your layout CSS file in another directory, for example your site root, then place a CSS file in each theme which simply contains

@import "/GlobalLayout.css"

That way you only have the CSS in one file, but get the benefits of ASP.NET Theme's auto-linking

http://css-discuss.incutio.com/?page=ImportHack

Adam Pope
Interesting angle. Appreciate the help.
Sash