I modified Bootstrap SASS (v3.3.5) based on Rukshan's answer
Add this in the end of the calc-grid-column
mixin in mixins/_grid-framework.scss
, right below the $type == offset
if condition.
@if ($type == offset-right) {
.col-#{$class}-offset-right-#{$index} {
margin-right: percentage(($index / $grid-columns));
}
}
Modify the make-grid
mixin in mixins/_grid-framework.scss
to generate the offset-right
classes.
// Create grid for specific class @mixin make-grid($class) { @include float-grid-columns($class); @include loop-grid-columns($grid-columns, $class, width); @include loop-grid-columns($grid-columns, $class, pull); @include loop-grid-columns($grid-columns, $class, push); @include loop-grid-columns($grid-columns, $class, offset); @include loop-grid-columns($grid-columns, $class, offset-right); }
You can then use the classes like col-sm-offset-right-2
and col-md-offset-right-1