Skip to content

Instantly share code, notes, and snippets.

@zearadoua
Created September 25, 2017 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zearadoua/a4c1d4a6ac6a0930d5be80e4a75cb046 to your computer and use it in GitHub Desktop.
Save zearadoua/a4c1d4a6ac6a0930d5be80e4a75cb046 to your computer and use it in GitHub Desktop.
bootstrap mixin for rtl
@mixin rtl() {
html[dir=rtl] & {
@content;
}
}
// float element right in rtl
@mixin float-columns-right($class, $i: 1, $list: ".col-#{$class}-#{$i}") {
@for $i from (1 + 1) through $grid-columns {
$list: "#{$list}, .col-#{$class}-#{$i}";
}
#{$list} {
@include rtl(){
float: right;
}
}
}
@include float-columns-right(xs);
@media (min-width: $screen-sm-min) {
@include float-columns-right(sm);
}
@media (min-width: $screen-md-min) {
@include float-columns-right(md);
}
@media (min-width: $screen-lg-min) {
@include float-columns-right(lg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment