Merge pull request #2131 from sjpadgett/portal-tables
[openemr.git] / interface / themes / directional.scss
blob6934b02bd6a0b9b67346ae283e5b21994a31cee3
1 // directional-scss | Author: Tyson Matanich (http://matanich.com), 2013 | License: MIT
2 $dir: ltr !default;
4 // Default $dir if not valid
5 @if $dir != ltr and $dir != rtl {
6     $dir: ltr;
9 @function if-ltr($if, $else: null) {
10   @if $dir != rtl {
11     @return $if;
12   }
13   @else {
14     @return $else;
15   }
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);
29   }
30   @else {
31     @return $values;
32   }
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);
40         }
41         @else if length($values) == 3 {
42                 @return nth($values, 2) nth($values, 1) nth($values, 2) nth($values, 3);
43         }
44         @else {
45                 @return nth($values, 2) nth($values, 1) nth($values, 4) nth($values, 3);
46         }
47   }
48   @else {
49     @return $values;
50   }
53 @mixin if-ltr { 
54   @if $dir != rtl {
55     @content;
56   }
59 @mixin if-rtl {
60   @if $dir == rtl {
61     @content;
62   }