by Rusty Swayne 4.July 2007 20:00
ASP.NET 2.0 themes provide a very nice way of organizing an applications stylesheets and formatting images. However, if you have multiple stylesheets housed inside a theme they get added to the page in alphabetical order which can obviously create some issues as the styles start to "cascade."
At Mindfly's studio we add four stylesheets to any given theme (a methodology we adopted after meeting Andy Clarke at Web Directions North and subsequently reading his book transcending CSS)
- normalize.css - This removes any default styles that a browser may associate with a tag such as h1 or p.
- layout.css - Positioning, margins, padding, floats, etc.
- type.css - Typography.
- color.css - Colors and backgrounds.
Adding these to the head in alphabetical order would cause a few issues as normalize.css is added after color.css and layout.css thus removing any previously applied styles.
Mindfly simply adds an alpha prefix to each stylesheet to work around this issue.
- a_normalize.css
- b_layout.css
- c_type.css
- d_color.css