Version 2 of Twitters \"Bootstrap\" UI framework was released today. While I find it very handy, I dislike how non-semantic it is.
I\'d rather avoid setting class
ok in less, this is how I figured it out. Its the best I could do, and I couldn't figure out how to deal with .row semantically, but oh well.
Basically I created a custom-mixins.less and created a mixin called .col and the variable is @col. So when you write your selector and do something like .col(3); .col(4); .col(5); or something like that. It should create the proper width. I don't know how this would work for nested columns.
//custom-mixins.less
.col (@col) {
#gridSystem > .gridColumn(@gridGutterWidth);
#gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, @col);
}
//styles.less
.greetings {
.col(3);
}
lessc will generate the following in styles.css
//styles.css
.greetings {
float: left;
margin-left: 20px;
width: 220px;
}