Skip to content

Instantly share code, notes, and snippets.

@saeedseyfi
Created September 2, 2016 11:43
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save saeedseyfi/4eb9f4634d5eb053da05375c59092da8 to your computer and use it in GitHub Desktop.
Save saeedseyfi/4eb9f4634d5eb053da05375c59092da8 to your computer and use it in GitHub Desktop.
RTL/LTR support using sass mixins.
$layout-direction: ltr !default;
@mixin ltr {
@if $layout-direction == ltr {
@content;
}
}
@mixin rtl {
@if $layout-direction == rtl {
@content;
}
}
@import "direction.scss";
.my-element {
padding: 50px;
background: yellow;
@include rtl {
float: right;
}
@include rtl {
float: left;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment