twitter/bootstrap — Issue #1056: Could :first-child be used instead of negative left margin on rows?
Author: bokkagroup
Created: 2012-01-18 22:03:56+00:00
State: open

Many times we'd like to put top or bottom borders on rows. However, our first span never lines up with the border because rows appear to have a negative left margin to offset the left margin (gutter width) of the first span. That means we have to add additional elements to get borders that align correctly.

Building off of your own code in scaffolding.less, couldn't you use the first-child pseudo-selector instead?
.row{
.clearfix();
// margin-left: -@gridGutterWidth; //no longer necessary
}

.row > [class*="span"]:first-child{
margin-left:0;
}

From what I've seen, first-child has support back to IE7 (as [class*="span"] does) and would be cleaner than adding negative margins to the rows and several additional elements (in my opinion).

I apologize in advance if there's an obvious reason this wouldn't work. I'm often blinded by my ignorance.