Skip to content

Commit

Permalink
Allow each component to have its own colors and default to the global…
Browse files Browse the repository at this point in the history
… set
  • Loading branch information
aredridel committed Aug 26, 2020
1 parent 3168205 commit 01cf4b2
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 11 deletions.
4 changes: 3 additions & 1 deletion sass/components/navbar.sass
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ $navbar-bottom-box-shadow-size: 0 -2px 0 0 !default

$navbar-breakpoint: $desktop !default

$navbar-colors: $colors !default

=navbar-fixed
left: 0
position: fixed
Expand All @@ -57,7 +59,7 @@ $navbar-breakpoint: $desktop !default
min-height: $navbar-height
position: relative
z-index: $navbar-z
@each $name, $pair in $colors
@each $name, $pair in $navbar-colors
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
&.is-#{$name}
Expand Down
4 changes: 3 additions & 1 deletion sass/elements/button.sass
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ $button-static-color: $text-light !default
$button-static-background-color: $scheme-main-ter !default
$button-static-border-color: $border !default

$button-colors: $colors !default

// The button sizes use mixins so they can be used at different breakpoints
=button-small
border-radius: $radius-small
Expand Down Expand Up @@ -115,7 +117,7 @@ $button-static-border-color: $border !default
background-color: transparent
border-color: transparent
box-shadow: none
@each $name, $pair in $colors
@each $name, $pair in $button-colors
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
&.is-#{$name}
Expand Down
4 changes: 3 additions & 1 deletion sass/elements/notification.sass
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ $notification-padding: 1.25rem 2.5rem 1.25rem 1.5rem !default
$notification-padding-ltr: 1.25rem 2.5rem 1.25rem 1.5rem !default
$notification-padding-rtl: 1.25rem 1.5rem 1.25rem 2.5rem !default

$notification-colors: $colors !default

.notification
@extend %block
background-color: $notification-background-color
Expand Down Expand Up @@ -33,7 +35,7 @@ $notification-padding-rtl: 1.25rem 1.5rem 1.25rem 2.5rem !default
.content
color: currentColor
// Colors
@each $name, $pair in $colors
@each $name, $pair in $notification-colors
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
&.is-#{$name}
Expand Down
4 changes: 3 additions & 1 deletion sass/elements/progress.sass
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ $progress-border-radius: $radius-rounded !default

$progress-indeterminate-duration: 1.5s !default

$progress-colors: $colors !default

.progress
@extend %block
-moz-appearance: none
Expand All @@ -25,7 +27,7 @@ $progress-indeterminate-duration: 1.5s !default
background-color: $progress-value-background-color
border: none
// Colors
@each $name, $pair in $colors
@each $name, $pair in $progress-colors
$color: nth($pair, 1)
&.is-#{$name}
&::-webkit-progress-value
Expand Down
4 changes: 3 additions & 1 deletion sass/elements/table.sass
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ $table-row-active-color: $primary-invert !default
$table-striped-row-even-background-color: $scheme-main-bis !default
$table-striped-row-even-hover-background-color: $scheme-main-ter !default

$table-colors: $colors !default

.table
@extend %block
background-color: $table-background-color
Expand All @@ -34,7 +36,7 @@ $table-striped-row-even-hover-background-color: $scheme-main-ter !default
padding: $table-cell-padding
vertical-align: top
// Colors
@each $name, $pair in $colors
@each $name, $pair in $table-colors
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
&.is-#{$name}
Expand Down
4 changes: 3 additions & 1 deletion sass/elements/tag.sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ $tag-color: $text !default
$tag-radius: $radius !default
$tag-delete-margin: 1px !default

$tag-colors: $colors !default

.tags
align-items: center
display: flex
Expand Down Expand Up @@ -71,7 +73,7 @@ $tag-delete-margin: 1px !default
+ltr-property("margin", 0.25rem, false)
+ltr-property("margin", -0.375rem)
// Colors
@each $name, $pair in $colors
@each $name, $pair in $tag-colors
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
&.is-#{$name}
Expand Down
4 changes: 3 additions & 1 deletion sass/form/file.sass
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ $file-name-border-style: solid !default
$file-name-border-width: 1px 1px 1px 0 !default
$file-name-max-width: 16em !default

$file-colors: $form-colors !default

.file
@extend %unselectable
align-items: stretch
display: flex
justify-content: flex-start
position: relative
// Colors
@each $name, $pair in $colors
@each $name, $pair in $file-colors
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
&.is-#{$name}
Expand Down
4 changes: 3 additions & 1 deletion sass/form/input-textarea.sass
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ $textarea-padding: $control-padding-horizontal !default
$textarea-max-height: 40em !default
$textarea-min-height: 8em !default

$textarea-colors: $form-colors !default

%input-textarea
@extend %input
box-shadow: $input-shadow
Expand All @@ -10,7 +12,7 @@ $textarea-min-height: 8em !default
&[readonly]
box-shadow: none
// Colors
@each $name, $pair in $colors
@each $name, $pair in $textarea-colors
$color: nth($pair, 1)
&.is-#{$name}
border-color: $color
Expand Down
4 changes: 3 additions & 1 deletion sass/form/select.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$select-colors: $form-colors !default

.select
display: inline-block
max-width: 100%
Expand Down Expand Up @@ -39,7 +41,7 @@
&::after
border-color: $input-hover-color
// Colors
@each $name, $pair in $colors
@each $name, $pair in $select-colors
$color: nth($pair, 1)
&.is-#{$name}
&:not(:hover)::after
Expand Down
2 changes: 2 additions & 0 deletions sass/form/shared.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$form-colors: $colors !default

$input-color: $text-strong !default
$input-background-color: $scheme-main !default
$input-border-color: $border !default
Expand Down
4 changes: 3 additions & 1 deletion sass/form/tools.sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ $label-weight: $weight-bold !default

$help-size: $size-small !default

$label-colors: $form-colors !default

.label
color: $label-color
display: block
Expand All @@ -22,7 +24,7 @@ $help-size: $size-small !default
display: block
font-size: $help-size
margin-top: 0.25rem
@each $name, $pair in $colors
@each $name, $pair in $label-colors
$color: nth($pair, 1)
&.is-#{$name}
color: $color
Expand Down
4 changes: 3 additions & 1 deletion sass/layout/hero.sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ $hero-body-padding-small: 1.5rem !default
$hero-body-padding-medium: 9rem 1.5rem !default
$hero-body-padding-large: 18rem 1.5rem !default

$hero-colors: $colors !default

// Main container
.hero
align-items: stretch
Expand All @@ -15,7 +17,7 @@ $hero-body-padding-large: 18rem 1.5rem !default
ul
border-bottom: none
// Colors
@each $name, $pair in $colors
@each $name, $pair in $hero-colors
$color: nth($pair, 1)
$color-invert: nth($pair, 2)
&.is-#{$name}
Expand Down

0 comments on commit 01cf4b2

Please sign in to comment.