Foundation 4.3: Paving the Road to 5
zurb.com
zurb.com
What I never liked about the Bootstrap/Foundation CSS frameworks was having to mark up my HTML with those damn "small-4 large-8 columns" attributes. It felt to me like that purely-visual stuff should be kept in the CSS, not the HTML.
So I was thrilled when I found I didn't have to put any of that in the HTML - that it could all go in the SCSS, which then parses/compiles it into the final public CSS.
So you can just have:
<div id="sidebar">blah</div>
<div id="article">blah</div>
... then in your SCSS file, do this: div#sidebar {
@extend .columns;
@extend .small-3;
}
div#article {
@extend .columns;
@extend .small-9;
}
... and that's it! It adds those selectors to the final CSS file and your semantic HTML will have the layout/look you want.To me, that changed everything, and I've been a fan since.
This has been covered other places, but I don't think it's been covered enough, and I think it was another HN commenter that turned me onto it like this, so just paying it forward in case someone else didn't know yet.
@include grid-column(3);
(There's a mixin for practically everything, documented at the bottom of every docs page, eg http://foundation.zurb.com/docs/components/grid.html)I highly recommend looking at Object Oriented CSS and Ian Storm Taylor's great post on combining it with SASS: http://ianstormtaylor.com/oocss-plus-sass-is-the-best-way-to...
Using SASS placeholders and @extend'ing your framework's classes are a great way to reduce code duplication and complexity. I recently redid our entire frontend using these techniques and it reduced our SASS code by about 30-40%, got rid of plenty of gnarly nested classes, and made it drastically easier to start adding new features.
In general although I appreciate the larger CSS frameworks from a documentation and organization standpoint I find that their expanded use over the last year to lead to the "Oh, this was built with X" sameyness in a lot of new projects across the web. You even see newer frameworks like purecss.io that are trying to remove the actual styling from the framework itself, concentrating instead on base elements. I'm curious to see how this will all transition over the next couple years.
I'm a frontend designer myself so I'm biased, but I think relying heavily on any of them too much can limit your product once you get past the prototype stage. That said, I've learned so much over the past year just being able to look through their documentation and see proper smacss principles at work on large projects.
It's along the same lines as what you suggested above.
https://github.com/thomas-mcdonald/bootstrap-sass
(You don't have to use it as a ruby gem, you can just download the source same as you do original less bootstrap, if you want)
[1] http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#va...
The guys behind it are great too. I've had questions answered quickly by the devs, and they even sent me some stickers and this weird wooden puzzle thing that I keep on my desk!
tl;dr - Definitely worth checking out.
Hopefully they can focus on improving some of these JavaScript components. I just don't have the resources right now to contribute pull requests when I run into problems - it's usually easier to completely ditch the component or write a bespoke version using a Backbone view.
I am defensively disposing of everything in DOM when not used and it seems just wrong to keep using UI components that are clueless to their state and everything is done by hiding content in the DOM.
https://github.com/amarsahinovic/django-zurb-foundation/
https://bitbucket.org/amarsahinovic/django-zurb-foundation/
Edit: I just uploaded it to PyPI, it was easier than I thought :)
Still waiting for Bootstrap3 - don't understand why Bootstrap is so far behind wrt responsive layouts.