| 1 |
@charset "UTF-8"; |
| 2 |
|
| 3 |
/// Changes the direction property used by other mixins called in the code block argument. |
| 4 |
/// |
| 5 |
/// @param {String} $direction [left-to-right] |
| 6 |
/// Layout direction to be used within the block. Can be `left-to-right` or `right-to-left`. |
| 7 |
/// |
| 8 |
/// @example scss - Usage |
| 9 |
/// @include direction-context(right-to-left) { |
| 10 |
/// .right-to-left-block { |
| 11 |
/// @include span-columns(6); |
| 12 |
/// } |
| 13 |
/// } |
| 14 |
/// |
| 15 |
/// @example css - CSS Output |
| 16 |
/// .right-to-left-block { |
| 17 |
/// float: right; |
| 18 |
/// ... |
| 19 |
/// } |
| 20 |
|
| 21 |
@mixin direction-context($direction: left-to-right) { |
| 22 |
$scope-direction: $layout-direction; |
| 23 |
|
| 24 |
@if to-lower-case($direction) == "left-to-right" { |
| 25 |
$layout-direction: LTR !global; |
| 26 |
} @else if to-lower-case($direction) == "right-to-left" { |
| 27 |
$layout-direction: RTL !global; |
| 28 |
} |
| 29 |
|
| 30 |
@content; |
| 31 |
|
| 32 |
$layout-direction: $scope-direction !global; |
| 33 |
} |