views:

189

answers:

2

Is it possible to use Blueprint CSS and maintain a a respectable level of separation between presentation and content? I like how easy the framework is to use when designing forms, but am worried that the manner in which I use the css classes for columnizing elements is a bad practice.

For instance, say I have a 3 field form designed using blueprint:

<div class="container">
    <form action="" method="post" class="inline">               
        <fieldset> 
            <legend>Example</legend> 
            <div class="span-3"> 
                <label for="a">Label A:</label> 
                <input type="text" class="text" id="a" name="a" > 
            </div> 
            <div class="span-2"> 
                <label for="b">Label B:</label> 
                <input type="text" class="text" id="b" name="b" > 
            </div> 
            <div class="span-3"> 
                <label for="o">Label O:</label> 
                <input type="checkbox" id="o" name="o" value="true" checked="checked" class="checkbox">checkbox one
            </div> 
            <div class="span-2 last"> 
                <input type="submit" value="submit" class="button"> 
            </div> 
        </fieldset> 
    </form> 
</div>

Is using a class attribute with names like "span-2", "inline", and "last" a bad practice? Or am I missing the point?

UPDATE

This is talked about in more depth at: THE MYTH OF CONTENT AND PRESENTATION SEPARATION

+1  A: 

I would say it is bad practice. You should be coming up with more meaningful class names and ids that apply directly to your markup and then have those "use" things such as span-2 and last. This can be done using blueprint's compress.rb.

Details on using that can be found here: http://jdclayton.com/blueprints_compress_a_walkthrough.html

In particular to what you are talking about, you should be paying attention to the "semantic_classes" part.

theIV
So you are suggesting use of the semantic classes feature of compress.rb?
Merritt
Yes. If you were working on styling something like an hcard, and wanted to stick to the format, all of your classes would be defined for you. No reason to go and slap a bunch of spans, firsts, lasts and what have you in there.
theIV
+1  A: 

I'd say you're missing the point. If you want to style those elements you're going to have to give them a class or ID regardless, and any naming convention can become meaningful so long as it remains consistent. The people who like to complain about the names of your classes generally aren't very good designers.

Azeem.Butt
"Non-semantic class name hurt nothing." - From the article I mention above.
Merritt