Rusty S. Swayne

tidbits and tangents

Rusty S. Swayne

My name is Russell S. Swayne although I have gone by Rusty all of my life. I own a small web design/development studio named Mindfly (http://www.mindfly.com), have a wonderful wife and very precocious and yet extremely charming daughter.

contact me Feed
 

CSS stylesheet organization in ASP.NET Themes

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)

  1. normalize.css - This removes any default styles that a browser may associate with a tag such as h1 or p.
  2. layout.css - Positioning, margins, padding, floats, etc.
  3. type.css - Typography.
  4. 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.

  1. a_normalize.css
  2. b_layout.css
  3. c_type.css
  4. d_color.css

 

Add comment


(Will show your Gravatar icon)  





Live preview

said...

-July 6. 2008 08:51

 
 

Powered by BlogEngine.NET 1.2.0.0. Original Design by Heather Alvis.
Sign in