
/* ONE light UI variables
** ---------------------------------------------- */

@import "syntax-variables";
.ui-syntax-color() { @syntax-background-color: hsl(220,1%,98%); } .ui-syntax-color(); // fallback color
@ui-syntax-color: @syntax-background-color;

// Color guards -----------------
@ui-hue:          hue(@ui-syntax-color);
@ui-saturation:   min( saturation(@ui-syntax-color), 24%); // max saturation
@ui-lightness:    max(  lightness(@ui-syntax-color), 92%); // min lightness

// Main colors -----------------
@ui-fg: hsl(@ui-hue, @ui-saturation, @ui-lightness - 66%);
@ui-bg: hsl(@ui-hue, @ui-saturation, @ui-lightness); // normalized @syntax-background-color





/* Official variables
** These variables must be defined in every theme
** Source: https://github.com/atom/atom/blob/master/static/variables/ui-variables.less
** ---------------------------------------------- */


// Text -----------------
@text-color:            @ui-fg;
@text-color-subtle:     fadeout(@text-color, 30%);
@text-color-highlight:  hsl(@ui-hue, @ui-saturation + 20%, 30%);
@text-color-selected:   darken(@text-color-highlight, 10%);

@text-color-info:    hsl(208, 100%, 54%);
@text-color-success: hsl(132,  60%, 44%);
@text-color-warning: hsl( 37,  90%, 44%);
@text-color-error:   hsl(  0,  90%, 56%);


// Background -----------------
@background-color-info:    hsl(208, 100%, 56%);
@background-color-success: hsl(132,  48%, 48%);
@background-color-warning: hsl( 40,  60%, 52%);
@background-color-error:   hsl(  0,  60%, 56%);

@background-color-highlight: hsla(@ui-hue, 10% + @ui-saturation, 50%,.12);
@background-color-selected:  hsla(@ui-hue, 10% + @ui-saturation, 50%,.18);

@app-background-color: @level-3-color;


// Base -----------------
@base-background-color: @ui-bg;
@base-border-color:     darken(@base-background-color, 12%);


// Components -----------------
@pane-item-background-color:       @base-background-color;
@pane-item-border-color:           @base-border-color;

@input-background-color:           @level-1-color;
@input-border-color:               @base-border-color;

@tool-panel-background-color:      @level-3-color;
@tool-panel-border-color:          @base-border-color;

@inset-panel-background-color:     lighten(@level-2-color, 4%);
@inset-panel-border-color:         fadeout(@base-border-color, 15%);

@panel-heading-background-color:   @level-2-color;
@panel-heading-border-color:       @base-border-color;

@overlay-background-color:         @level-2-color;
@overlay-border-color:             @base-border-color;

@button-background-color:          @level-1-color;
@button-background-color-hover:    darken(@button-background-color, 4%);
@button-background-color-selected: lighten(@base-accent-color, 4%);
@button-border-color:              @base-border-color;

@tab-bar-background-color:         @level-3-color;
@tab-bar-border-color:             @base-border-color;
@tab-background-color:             @level-3-color;
@tab-background-color-active:      @level-2-color;
@tab-border-color:                 @base-border-color;

@tree-view-background-color:       @level-3-color;
@tree-view-border-color:           @base-border-color;

@ui-site-color-1: hsl(132,  48%, 48%); // green
@ui-site-color-2: hsl(208, 100%, 56%); // blue
@ui-site-color-3: hsl( 40,  60%, 52%); // orange
@ui-site-color-4: #D831B0;             // pink
@ui-site-color-5: #EBDD5B;             // yellow


// Sizes -----------------
@font-size:               11px;
@input-font-size:         14px;
@disclosure-arrow-size:   12px;

@component-padding:       10px;
@component-icon-padding:  5px;
@component-icon-size:     16px; // needs to stay 16px to look sharpest
@component-line-height:   25px;
@component-border-radius: 3px;

@tab-height:              30px;


// Font -----------------
@font-family: 'Lucida Grande', 'Segoe UI', Ubuntu, Cantarell, sans-serif;





/* Custom variables
** These variables are only used in this theme
** ---------------------------------------------- */

// Text (Custom) -----------------
@text-color-faded: fade(@text-color, 30%);

@text-color-added:    @text-color-success;  // green
@text-color-ignored:  @text-color-subtle;   // faded
@text-color-modified: @text-color-warning;  // orange
@text-color-removed:  @text-color-error;    // red
@text-color-renamed:  @text-color-info;     // blue


// Background (Custom) -----------------
@level-1-color: lighten(@base-background-color, 4%);
@level-2-color: @base-background-color;
@level-3-color: darken(@base-background-color, 6%);


// Base (Custom) -----------------
@base-accent-color: hsl(@ui-hue, @ui-saturation + 80%, min(@ui-lightness - 40%, 60%) );


// Components (Custom) -----------------
@badge-background-color:           fadein(@background-color-highlight, 8%);

@button-text-color-selected:       contrast(@button-background-color-selected, hsl(@ui-hue,100%,100%), hsl(@ui-hue,100%,12%), 40% );
@button-border-color-selected:     @base-accent-color;

@checkbox-background-color:        fade(@base-accent-color, 33%);

@input-background-color-focus:     mix(@base-accent-color, @input-background-color, 6%);
@input-selection-color:            @background-color-selected;
@input-selection-color-focus:      fadein(@background-color-selected, 6%);

@key-binding-border-color:         @base-border-color;
@key-binding-background-color:     @level-2-color;

@overlay-backdrop-color:           hsla(@ui-hue,@ui-saturation,5%,.5);

@progress-background-color:        @base-accent-color;

@scrollbar-color:                  @level-1-color;
@scrollbar-background-color:       @level-3-color; // replaced `transparent` with a solid color to test https://github.com/atom/one-light-ui/issues/4

@tab-text-color:                   @text-color-subtle;
@tab-text-color-active:            @text-color-highlight;
@tab-text-color-editor:            contrast(@ui-syntax-color, lighten(@ui-syntax-color, 70%), @text-color-highlight );
@tab-icon-color:                   @text-color-subtle;
@tab-background-color-editor:      @ui-syntax-color;

@tooltip-background-color:         @base-accent-color;
@tooltip-text-color:               contrast(@tooltip-background-color, hsl(@ui-hue,100%,100%), hsl(@ui-hue,100%,12%), 40% );
@tooltip-text-key-color:           @tooltip-background-color;
@tooltip-background-key-color:     @tooltip-text-color;


// Sizes (Custom) -----------------

@ui-size:                 1em;
@ui-input-size:           @ui-size*1.25;
@ui-padding:              @ui-size*1.5;
@ui-padding-icon:         @ui-padding/3.3;
@ui-line-height:          @ui-size*2;
@ui-tab-height:           @ui-padding*2;





/* Packages variables
** These variables are used to override packages
** ---------------------------------------------- */

@settings-list-background-color: darken(@level-2-color, 3%);
@theme-config-box-shadow: inset 0 1px 2px hsla(0, 0%, 0%, .2), 0 1px 0 hsla(0, 0%, 100%, .3);
@theme-config-box-shadow-selected: inset 0 1px 3px hsla(0, 0%, 0%, .2);
@theme-config-border-selected: hsla(0, 0%, 0%, .5);

@markdown-preview-color: @text-color;
@markdown-preview-background-color: lighten(@base-background-color, 3%);
@markdown-preview-hr-color: lighten(@base-background-color, 3%);
@markdown-preview-code-color: lighten(@text-color, 10%);
@markdown-preview-code-background-color: darken(@base-background-color, 1%);



/* Debug
** Output variables to the top of the UI
** ------------------------------------- */

// html:before {
//   content: "@{variable}";
// }
