///*------------------------------------*\
//    # RIGHT TO LEFT (RTL)
//\*------------------------------------*/

// The following variables are used to provide support for Right to Left
// langauges. These variables are used in conjunction with the `flip` function.
//
// To provide RTL support we need to adjust a combination of properties and values.
// Values can be adjusted using the `flip` function and properties adjusted using the
// interpolation variables.


/// RTL
//
// By default RTL support is disabled. This can be enabled by defining an `$rtl` variable
// before importing the `gel-sass-tools`. When set to true the `$rtl` variable will change
// the output of the `flip` function and the value of the interpolated property variables below.
//
// @type Bool
//
$rtl: false !default;



/// Interpolated Properties
//
// Interpolation is used for any property which has a direction (e.g. padding-left, margin-right,
// border-right, left, etc.). When using any of these properties interpolate the following variables
// so that there value can be controlled based on the value of the `$rtl` variable.
//
// .foo {
//     #{$padding-left}: $gel-spacing-unit;
//     #{$margin-left}: $gel-spacing-unit;
// }
//
// @type String
//
$margin-right:       'margin-right' !default;
$margin-left:        'margin-left' !default;
$border-right:       'border-right' !default;
$border-left:        'border-left' !default;
$border-left-width:  'border-left-width' !default;
$border-right-width: 'border-right-width' !default;
$border-left-color:  'border-left-color' !default;
$border-right-color: 'border-right-color' !default;
$border-left-style:  'border-left-style' !default;
$border-right-style: 'border-right-style' !default;
$padding-right:      'padding-right' !default;
$padding-left:       'padding-left' !default;
$right:              'right' !default;
$left:               'left' !default;


// If the `$rtl` variable is `true` flip the direction of the interpolated properties
//
@if $rtl {
    $margin-right:       'margin-left';
    $margin-left:        'margin-right';
    $border-right:       'border-left';
    $border-left:        'border-right';
    $border-left-width:  'border-right-width';
    $border-right-width: 'border-left-width';
    $border-left-color:  'border-right-color';
    $border-right-color: 'border-left-color';
    $border-left-style:  'border-right-style';
    $border-right-style: 'border-left-style';
    $padding-right:      'padding-left';
    $padding-left:       'padding-right';
    $right:              'left';
    $left:               'right';
}
