Friday, April 30, 2010

CSS is not a programming language. Stop it.

I just read this post: http://www.codinghorror.com/blog/2010/04/whats-wrong-with-css.html

CSS is not a programming language and most importantly should not be turned into one. This article is showing some of the advantages of third-party wrappers, which I'm also a fan of, but programming language is where it becomes muddy waters.

The two wrappers he mentions, LessCSS and SASS (like Rosemary), are better off as helpers.

Style is about taking an object and giving it attributes, that's it. If you have a naked human being, you add attributes to style them up like any Create-A-Character you've ever used. Add a top, add a bottom, add shoes, add accessories, there you go.. styled. That's it.

When you have the ability to wrap something like CSS, it can often be dangerous. Some people are like, "Well, I like the syntax of programming language X, so let's make it that way." Well, CSS isn't like programming language X for a reason. It's not a programming language.

Why does this bother me? Not because of these wrappers or mine. I think they're fine. Variables and other small things, like including files so you can break out large stylesheets, or dynamic browser checking, that help encourage DRY philosophy is cool with me.


CSS3 is what annoys me.

CSS Marquee Animating anything is the job of Javascript. HTML is structure. CSS is style. Javascript is motion. Don't mix the liquids because then responsibilities are forgotten. Leave animation out of CSS.

CSS Animations This does not belong. It looks cute and all, but it doesn't belong.


People really just need to understand what different languages are, what they're for, and why they're using them.