by FilterJoe · 13y ago · 0 comments
I did look at their templates site:
http://foundation.zurb.com/templates.php
and I still see presentational markup.
EDIT: I'd also like to see a sample SCSS mixin which attaches the style to the HTML. Something as simple as styling a few "Hello world" phrases arranged in a grid would be great.
------
EXAMPLE: http://foundation.zurb.com/page-templates4/blog.html
Line 45: <div class="large-9 columns">
CSS: .row .large-9 { position: relative; width: 75%; } .row .columns { position: relative; padding-left: 0.9375em; padding-right: 0.9375em; float: left; }
------
With 'the magic of Scss', you could replace multiple presentational classes with a single class that refers to the element's content or purpose, and then use @extend for the above-defined grid classes.
So our new HTML would look like:
<div class="article-content">
And the Scss:
.article-content { @extend .large-9; @extend .columns; }
------
Edit: formatting, also: there are plenty of debates to be had about writing classes this way. The subject merits its own lengthy discussion and (I think) the answer changes depending on what you're trying to do, so I ain't touchin it.
I'd personally stick with the presentation classes for most cases though. The templates likely do it this way so you can just throw the Foundation CSS on and it's ready to go.
EDIT: Thinking more about it, I think a huge advantage is that if you had an already-structured HTML file, you could write up a few @extend rules and apply a grid without having to add classes to everything. (You could use this technique to quickly throw up a grid for something like http://csszengarden.com/)
It's selector inheritance -- rewriting selectors instead of repeating properties & values.
The idea is to get something like this :
@mixin three-column {
.container { @include container; }
.header,
.footer { @include column(24); }
.sidebar { @include column(6); }
article { @include column(10); }
.rightbar { @include column(8); }
}
body#article,
body#snippet,
body#blog-post { @include three-column; }
I describe the whole thing with examples here:
https://github.com/niclupien/compass-examples/wiki/Example-0...Just scroll down to the "Build with Mixins" section.