Created
September 2, 2016 11:43
-
-
Save saeedseyfi/4eb9f4634d5eb053da05375c59092da8 to your computer and use it in GitHub Desktop.
RTL/LTR support using sass mixins.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$layout-direction: ltr !default; | |
@mixin ltr { | |
@if $layout-direction == ltr { | |
@content; | |
} | |
} | |
@mixin rtl { | |
@if $layout-direction == rtl { | |
@content; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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