1 // directional-scss | Author: Tyson Matanich (http://matanich.com), 2013 | License: MIT
4 // Default $dir if not valid
5 @if $dir != ltr and $dir != rtl {
9 @function if-ltr($if, $else: null) {
18 @function if-rtl($if, $else: null) {
19 @return if-ltr($else, $if);
22 $left: if-ltr(left, right);
23 $right: if-ltr(right, left);
25 @function side-values($values) {
26 @if $dir == rtl and length($values) >= 4 {
27 // Reorder right and left positions in list
28 @return nth($values, 1) nth($values, 4) nth($values, 3) nth($values, 2);
35 @function corner-values($values) {
36 @if $dir == rtl and length($values) > 1 {
37 // Reorder right and left positions in list
38 @if length($values) == 2 {
39 @return nth($values, 2) nth($values, 1);
41 @else if length($values) == 3 {
42 @return nth($values, 2) nth($values, 1) nth($values, 2) nth($values, 3);
45 @return nth($values, 2) nth($values, 1) nth($values, 4) nth($values, 3);