Skip to content

Commit

Permalink
Use better color naming for style guide Sass variables
Browse files Browse the repository at this point in the history
Instead of referring to generic `$color-1` variables we should be using
explicitly named Sass variables.
  • Loading branch information
graygilmore committed Aug 9, 2017
1 parent 004c7d0 commit 546825a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ $color-error: $color-5 !default;
// Color for spinner
$color-spinner: #fff;

// Style Guide
$color-style-guide-code: darken($color-7, 10%);
$color-style-guide-link: darken($color-7, 65%);
$color-style-guide-nav: $color-7;
$color-style-guide-nav-border: darken($color-7, 5%);
$color-style-guide-nav-link: darken($color-7, 65%);
$color-style-guide-nav-link-hover: darken($color-7, 5%);
$color-style-guide-section-border: darken($color-7, 10%);
$color-style-guide-swatch-border: darken($color-7, 10%);

// Table colors
$color-tbl-odd: $color-1 !default;
$color-tbl-even: very-light($color-3, 4) !default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

&-sidebar {
width: 225px;
background: $color-7;
background: $color-style-guide-nav;
padding: 1.5rem;

.brand-link {
Expand Down Expand Up @@ -41,7 +41,7 @@
@include padding(0.75rem null);

&:not(:first-of-type) {
border-top: 1px solid darken($color-7, 5%);
border-top: 1px solid $color-style-guide-nav-border;
}

> a {
Expand All @@ -52,11 +52,11 @@

a {
display: block;
color: darken($color-7, 65%);
color: $color-style-guide-nav-link;
padding: 0.3rem 0.5rem;

&:hover {
background: darken($color-7, 5%);
background: $color-style-guide-nav-link-hover;
}
}
}
Expand All @@ -68,7 +68,7 @@

&-section-header {
@include margin(7rem 0 3rem);
border-bottom: 1px solid darken($color-7, 10%);
border-bottom: 1px solid $color-style-guide-section-border;
font-size: 1.5rem;
font-weight: bold;
line-height: 0.2;
Expand All @@ -81,7 +81,7 @@
}

a {
color: darken($color-7, 65%);
color: $color-style-guide-link;
}
}

Expand All @@ -101,7 +101,7 @@
&-code {
pre {
margin: 0;
border: 1px solid darken($color-7, 10%);
border: 1px solid $color-style-guide-code;
}
}

Expand Down Expand Up @@ -132,6 +132,6 @@

.color-swatch {
height: 50px;
border: 1px solid darken($color-7, 10%);
border: 1px solid $color-style-guide-swatch-border;
}
}

0 comments on commit 546825a

Please sign in to comment.