|
15 | 15 | }
|
16 | 16 |
|
17 | 17 | @function reflect($element) {
|
18 |
| - @if type-of($element) == string { |
19 |
| - @if str-index($element, "left") { |
20 |
| - @return str-replace($element, "left", "right"); |
21 |
| - } |
22 |
| - @if str-index($element, "right") { |
23 |
| - @return str-replace($element, "right", "left"); |
24 |
| - } |
| 18 | + $string: #{$element}; |
| 19 | + @if str-index($string, "left") { |
| 20 | + @return str-replace($string, "left", "right"); |
| 21 | + } |
| 22 | + @if str-index($string, "right") { |
| 23 | + @return str-replace($string, "right", "left"); |
25 | 24 | }
|
26 | 25 |
|
27 |
| - @return $element; |
| 26 | + @return unquote($string); |
28 | 27 | }
|
29 | 28 |
|
30 | 29 | @mixin ltr-rtl($property, $value, $property-rtl: null, $value-rtl: null, $important: null) {
|
|
59 | 58 | }
|
60 | 59 | }
|
61 | 60 |
|
62 |
| -@mixin ltr-rtl-value-only($property, $value, $value-rtl, $important: null) { |
| 61 | +@mixin ltr-rtl-value-only($property, $value, $value-rtl: null, $important: null) { |
63 | 62 | $value-reflected: reflect($value);
|
64 | 63 |
|
65 | 64 | @if $enable-ltr and $enable-rtl {
|
66 | 65 | @include ltr() {
|
67 | 66 | #{$property}: $value $important;
|
68 | 67 | }
|
69 | 68 | @include rtl() {
|
70 |
| - #{$property}: $value-rtl $important; |
| 69 | + @if $value-rtl { |
| 70 | + #{$property}: $value-rtl $important; |
| 71 | + } @else { |
| 72 | + #{$property}: $value-reflected $important; |
| 73 | + } |
71 | 74 | }
|
72 | 75 | }
|
73 | 76 | @else {
|
74 | 77 | @if $enable-rtl {
|
75 |
| - #{$property}: $value-rtl $important; |
76 |
| - } |
77 |
| - @else { |
| 78 | + @if $value-rtl { |
| 79 | + #{$property}: $value-rtl $important; |
| 80 | + } @else { |
| 81 | + #{$property}: $value-reflected $important; |
| 82 | + } |
| 83 | + } @else { |
78 | 84 | #{$property}: $value $important;
|
79 | 85 | }
|
80 | 86 | }
|
|
0 commit comments