Many fall into the habit of writing poor CSS, often due to a lack of structure. Here I present some common pitfalls, and tips by which to overcome them.
52. TIP #1
Use design principles
TIP #2
Order by speci city
TIP #3
Try CSS meta-frameworks
53. anks!
Any questions?
Matt Puchlerz Refresh Chicago
@mattpuchlerz
GeekFest
MayJun 15 12:48:09 -0500
26, 2010
Tue 2010
Editor's Notes
Web craftsman
One of many software craftspeople at Obtiva
Web craftsman
One of many software craftspeople at Obtiva
Web craftsman
One of many software craftspeople at Obtiva
Web craftsman
One of many software craftspeople at Obtiva
Web craftsman
One of many software craftspeople at Obtiva
Show of hands
Gross!
Point out nauseating parts; offer tips
Show of hands
Gross!
Point out nauseating parts; offer tips
Steve Smith (Ordered List) gave a talk on “Designing Code”
Don’t just write CSS, sculpt it.
Uneven brackets, indentation, spacing
No alignment
Could be whitespace between rules
Within properties is “progressive rhythm”… How to improve?
Alphabetize!
Items in close proximity to, or aligned with one another, ought to be grouped by similarity.
.error class in several spots
#header in several spots
Now that we are grouping well, be mindful of order
CSS properties are applied based on the specificity of their selector and their order.
Popular “frameworks” like Blueprint and 960.gs just give us defaults
“Metaframeworks” alter the way we write CSS