Skip to content
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.

Commit

Permalink
Merge pull request #145 from atom/sm-custom-vars
Browse files Browse the repository at this point in the history
Seperate variables
  • Loading branch information
simurai committed Jun 23, 2016
2 parents a4e95c1 + 80e4045 commit 4b927bb
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 139 deletions.
137 changes: 137 additions & 0 deletions styles/ui-variables-custom.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@

// ONE dark UI colors
// ----------------------------------------------

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

// Color guards -----------------
@ui-s-h: hue(@ui-syntax-color);
@ui-s-s: saturation(@ui-syntax-color);
@ui-s-l: lightness(@ui-syntax-color);
@ui-inv: 10%; // inverse lightness if below

.ui-hue() when (@ui-s-s = 0) { @ui-hue: 220; } // Use blue hue when no saturation
.ui-hue() when (@ui-s-s > 0) { @ui-hue: @ui-s-h; }
.ui-hue();

.ui-saturation() when (@ui-s-h <= 80) { @ui-saturation: min(@ui-s-s, 5%); } // minimize saturation for brown
.ui-saturation() when (@ui-s-h > 80) and (@ui-s-h < 160) { @ui-saturation: min(@ui-s-s, 12%); } // reduce saturation for green
.ui-saturation() when (@ui-s-h >= 160) and (@ui-s-l < @ui-inv) { @ui-saturation: min(@ui-s-s, 48%); } // limit max saturation for very dark backgrounds
.ui-saturation() when (@ui-s-h >= 160) and (@ui-s-l >= @ui-inv) { @ui-saturation: @ui-s-s; }
.ui-saturation();

.ui-lightness() when (@ui-s-l < @ui-inv) {
@ui-lightness: @ui-s-l + 8%; // increase lightness when too dark
@ui-lightness-border: @ui-lightness*.3;
}
.ui-lightness() when (@ui-s-l >= @ui-inv) {
@ui-lightness: min(@ui-s-l, 20%); // limit max lightness (for light syntax themes)
@ui-lightness-border: @ui-lightness*.6;
}
.ui-lightness();

// Main colors -----------------
@ui-fg: hsl(@ui-hue, min(@ui-saturation, 18%), max(@ui-lightness*3, 66%) );
@ui-bg: hsl(@ui-hue, @ui-saturation, @ui-lightness); // normalized @syntax-background-color
@ui-border: hsl(@ui-hue, @ui-saturation, @ui-lightness-border);




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

@ui-theme-name: one-dark-ui;

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

@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, 6%);
@level-2-color: @base-background-color;
@level-3-color: darken(@base-background-color, 3%);


// Base Accent (Custom) -----------------
@base-accent-color: hsl(@ui-hue, 100%, 66%);
@base-accent-text-color: lighten(@base-accent-color, 6%); // A bit lighter when used for smaller things
@base-accent-text-on-bg-color: contrast(@base-accent-color, white, hsl(@ui-hue,100%,10%), 33% );


// Components (Custom) -----------------
@badge-background-color: lighten(@background-color-highlight, 6%);

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

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

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

@key-binding-border-color: hsla(0,0%,100%,.1);
@key-binding-background-color: hsla(0,0%,100%,.1);

@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
@scrollbar-color-editor: contrast(@ui-syntax-color, darken(@ui-syntax-color, 18%), lighten(@ui-syntax-color, 9%) );
@scrollbar-background-color-editor: @ui-syntax-color;


@tab-text-color: @text-color-subtle;
@tab-text-color-active: @text-color-highlight;
@tab-text-color-editor: contrast(@ui-syntax-color, darken(@ui-syntax-color, 50%), @text-color-highlight );
@tab-background-color-editor: @ui-syntax-color;

@tooltip-background-color: @base-accent-color;
@tooltip-text-color: contrast(@tooltip-background-color, white, hsl(@ui-hue,100%,10%), 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.15;
@ui-padding: @ui-size*1.5;
@ui-padding-pane: @ui-size*.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, 1.5%);
@theme-config-box-shadow: inset 0 0 3px hsla(0, 0%, 100%, .4), 0 1px 3px hsla(0, 0%, 0%, .2);
@theme-config-box-shadow-selected: inset 0 1px 3px hsla(0, 0%, 0%, .1);
@theme-config-border-selected: hsla(0, 0%, 100%, .75);



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

// html:before {
// content: "@{variable}";
// }
141 changes: 2 additions & 139 deletions styles/ui-variables.less
Original file line number Diff line number Diff line change
@@ -1,46 +1,9 @@

@import "ui-variables-custom"; // import colors and custom variables

// ONE dark UI variables
// ----------------------------------------------

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

// Color guards -----------------
@ui-s-h: hue(@ui-syntax-color);
@ui-s-s: saturation(@ui-syntax-color);
@ui-s-l: lightness(@ui-syntax-color);
@ui-inv: 10%; // inverse lightness if below

.ui-hue() when (@ui-s-s = 0) { @ui-hue: 220; } // Use blue hue when no saturation
.ui-hue() when (@ui-s-s > 0) { @ui-hue: @ui-s-h; }
.ui-hue();

.ui-saturation() when (@ui-s-h <= 80) { @ui-saturation: min(@ui-s-s, 5%); } // minimize saturation for brown
.ui-saturation() when (@ui-s-h > 80) and (@ui-s-h < 160) { @ui-saturation: min(@ui-s-s, 12%); } // reduce saturation for green
.ui-saturation() when (@ui-s-h >= 160) and (@ui-s-l < @ui-inv) { @ui-saturation: min(@ui-s-s, 48%); } // limit max saturation for very dark backgrounds
.ui-saturation() when (@ui-s-h >= 160) and (@ui-s-l >= @ui-inv) { @ui-saturation: @ui-s-s; }
.ui-saturation();

.ui-lightness() when (@ui-s-l < @ui-inv) {
@ui-lightness: @ui-s-l + 8%; // increase lightness when too dark
@ui-lightness-border: @ui-lightness*.3;
}
.ui-lightness() when (@ui-s-l >= @ui-inv) {
@ui-lightness: min(@ui-s-l, 20%); // limit max lightness (for light syntax themes)
@ui-lightness-border: @ui-lightness*.6;
}
.ui-lightness();

// Main colors -----------------
@ui-fg: hsl(@ui-hue, min(@ui-saturation, 18%), max(@ui-lightness*3, 66%) );
@ui-bg: hsl(@ui-hue, @ui-saturation, @ui-lightness); // normalized @syntax-background-color
@ui-border: hsl(@ui-hue, @ui-saturation, @ui-lightness-border);





// Official variables
// These variables must be defined in every theme
// Source: https://github.com/atom/atom/blob/master/static/variables/ui-variables.less
Expand Down Expand Up @@ -132,103 +95,3 @@

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





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

@ui-theme-name: one-dark-ui;

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

@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, 6%);
@level-2-color: @base-background-color;
@level-3-color: darken(@base-background-color, 3%);


// Base Accent (Custom) -----------------
@base-accent-color: hsl(@ui-hue, 100%, 66%);
@base-accent-text-color: lighten(@base-accent-color, 6%); // A bit lighter when used for smaller things
@base-accent-text-on-bg-color: contrast(@base-accent-color, white, hsl(@ui-hue,100%,10%), 33% );


// Components (Custom) -----------------
@badge-background-color: lighten(@background-color-highlight, 6%);

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

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

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

@key-binding-border-color: hsla(0,0%,100%,.1);
@key-binding-background-color: hsla(0,0%,100%,.1);

@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
@scrollbar-color-editor: contrast(@ui-syntax-color, darken(@ui-syntax-color, 18%), lighten(@ui-syntax-color, 9%) );
@scrollbar-background-color-editor: @ui-syntax-color;


@tab-text-color: @text-color-subtle;
@tab-text-color-active: @text-color-highlight;
@tab-text-color-editor: contrast(@ui-syntax-color, darken(@ui-syntax-color, 50%), @text-color-highlight );
@tab-background-color-editor: @ui-syntax-color;

@tooltip-background-color: @base-accent-color;
@tooltip-text-color: contrast(@tooltip-background-color, white, hsl(@ui-hue,100%,10%), 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.15;
@ui-padding: @ui-size*1.5;
@ui-padding-pane: @ui-size*.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, 1.5%);
@theme-config-box-shadow: inset 0 0 3px hsla(0, 0%, 100%, .4), 0 1px 3px hsla(0, 0%, 0%, .2);
@theme-config-box-shadow-selected: inset 0 1px 3px hsla(0, 0%, 0%, .1);
@theme-config-border-selected: hsla(0, 0%, 100%, .75);



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

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

0 comments on commit 4b927bb

Please sign in to comment.