Template Framework / CSS

Topics: Controls, Themes
Aug 15, 2007 at 10:55 PM
I think there should be an easier way to apply or swap out layouts and css. Here is my suggestion. I have used it on other projects before and seems to work good.

Any control or user control, whether it be used to provide functionality or just templating, should have its corresponding CSS file. Then reference a single CSS file from the Master page that has CSS import directives: @import url("/css/real.css") to each control. And use naming standards to know which goes to which control.

This way when you do custom templating you only focus on the piece you need with out touching anything else. With a single style sheet you have to tend to scroll through and match up all the CSS classes or IDs back to the single style sheet. Or trying to copy and paste, and match up from another style shee to get the look you want. Which becomes tedious and WASTE LOTS OF TIME!

For example, if I liked the way a post entry looks for a another blog I can simply plug it in. If I like the comments section of someone else's blog, I can plug that in. Even though they live on the same page, it is easy to swap the pieces without editing anything.

This would be great for a template library where you could download different pieces instead of a whole theme: i.e. Master Page (header/footer/body), Default Page, Post Entry, Comments, etc. Just download and swap out what you need because each has it's own style sheet for the look and feel.

Could even build a simple CSS editor that takes a control as input and references the stylesheet for that control and renders the values in a user-friendly way or advanced (raw vaules) for editing.

I think you can get the point here. Whether you like everything or not, or just some, I thought I would pass on my ideas.