Last active
January 14, 2022 16:06
-
-
Save ilicmarko/95457dc605816c6f4f8ffde61fcd9d4a to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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
// Proveri da li je RTL mode. | |
@function is-rtl() { | |
@return $global-text-direction == 'rtl'; | |
} | |
// Okreni levu ili desnu stranu | |
@function invert($side) { | |
@return if($side == 'left', 'right', 'left'); // Ovo je kao ternari operator | |
} | |
// Dodaj spacing | |
@mixin spacing($side, $size) { | |
$side: if(is-rtl(), invert($side), $side); | |
margin-#{$side}: $size; | |
} | |
// Regular Mode | |
$global-text-direction: 'ltr'; | |
.header { | |
@include spacing('right', 10px); | |
} | |
// RTL Mode | |
$global-text-direction: 'rtl'; | |
.header { | |
@include spacing('right', 10px); | |
} |
This file contains 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
.header { | |
margin-right: 10px; | |
} | |
.header { | |
margin-left: 10px; | |
} |
This file contains 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
{ | |
"sass": { | |
"compiler": "dart-sass/1.32.12", | |
"extensions": {}, | |
"syntax": "SCSS", | |
"outputStyle": "expanded" | |
}, | |
"autoprefixer": false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment