Skip to content

Commit

Permalink
colors unify
Browse files Browse the repository at this point in the history
  • Loading branch information
codecalm committed Oct 27, 2021
1 parent 492649e commit 6e5c402
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 37 deletions.
3 changes: 2 additions & 1 deletion src/scss/_utilities.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
$margin-spacers: map-merge($spacers, (auto: auto, null: $spacer));

$border-values: (
null: $border-width solid $border-color-transparent,
wide: $border-width-wide solid $border-color-transparent,
Expand Down Expand Up @@ -108,4 +109,4 @@ $utilities: (
responsive: true,
values: 2 3 4
)
) !default;
) !default;
53 changes: 32 additions & 21 deletions src/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ $display-font-sizes: (
6: 2.5rem
) !default;

$small-font-size: percentage(divide($h5-font-size, $font-size-base)) !default;
$code-font-size: $small-font-size !default;
$code-line-height: 1.25rem !default;

$lead-font-size: $font-size-base !default;
$lead-font-weight: $font-weight-normal !default;

Expand Down Expand Up @@ -139,7 +135,32 @@ $info: $azure !default;
$warning: $orange !default;
$danger: $red !default;

$code-color: $primary !default;
$theme-colors: (
"primary": $primary,
"secondary": $secondary,
"success": $success,
"info": $info,
"warning": $warning,
"danger": $danger,
"light": $light,
"dark": $dark,
"muted": $text-muted
) !default;

$extra-colors: (
"blue": $blue,
"azure": $azure,
"indigo": $indigo,
"purple": $purple,
"pink": $pink,
"red": $red,
"orange": $orange,
"yellow": $yellow,
"lime": $lime,
"green": $green,
"teal": $teal,
"cyan": $cyan,
) !default;

$social-colors: (
"facebook": #3b5998,
Expand All @@ -159,22 +180,6 @@ $social-colors: (
"tabler": #206bc4
) !default;

$colors: (
"blue": $blue,
"azure": $azure,
"indigo": $indigo,
"purple": $purple,
"pink": $pink,
"red": $red,
"orange": $orange,
"yellow": $yellow,
"lime": $lime,
"green": $green,
"teal": $teal,
"cyan": $cyan,
) !default;


// Dark mode
$dark-mode-darken: darken($dark, 2%) !default;
$dark-mode-lighten: lighten($dark, 2%) !default;
Expand All @@ -190,6 +195,12 @@ $border-radius: 4px !default;
$border-radius-lg: 8px !default;
$border-radius-pill: 100rem !default;

// Code
$small-font-size: percentage(divide($h5-font-size, $font-size-base)) !default;
$code-color: $primary !default;
$code-font-size: $small-font-size !default;
$code-line-height: 1.25rem !default;

// Avatars
$avatar-size: 2.5rem !default;
$avatar-sizes: (
Expand Down
2 changes: 1 addition & 1 deletion src/scss/ui/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
$btn-colors: $theme-colors;

@if $enable-extra-colors {
$btn-colors: map-merge($btn-colors, $colors);
$btn-colors: map-merge($btn-colors, $extra-colors);
}

@if $enable-social-colors {
Expand Down
2 changes: 1 addition & 1 deletion src/scss/ui/_ribbons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}

@if $enable-extra-colors {
@each $color, $value in $colors {
@each $color, $value in $extra-colors {
&.bg-#{$color} {
border-color: $value;
}
Expand Down
2 changes: 1 addition & 1 deletion src/scss/ui/_steps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@include step-color($primary);
}

@each $color, $value in $colors {
@each $color, $value in $extra-colors {
.steps-#{$color} {
@include step-color($value);
}
Expand Down
36 changes: 24 additions & 12 deletions src/scss/utils/_colors.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
// stylelint-disable declaration-no-important

/**
SOCIAL COLORS
*/
@each $color, $value in $social-colors {
.bg-#{"" + $color} {
color: #fff !important;
background: $value !important;
}

.text-#{"" + $color} {
@each $color, $value in $theme-colors {
.bg-#{"" + $color}-lt {
color: $value !important;
background: theme-color-lighter($value, true) !important;
}
}


// Extra colors
@if $enable-extra-colors {
@each $color, $value in map-merge($colors, ( muted: $text-muted )) {
@each $color, $value in $extra-colors {
.bg-#{"" + $color} {
background: $value;
}
Expand All @@ -31,3 +24,22 @@ SOCIAL COLORS
}
}
}

// Social colors
@if $enable-social-colors {
@each $color, $value in $social-colors {
.bg-#{"" + $color} {
color: #ffffff !important;
background: $value !important;
}

.text-#{"" + $color} {
color: $value !important;
}

.bg-#{"" + $color}-lt {
color: $value !important;
background: theme-color-lighter($value, true) !important;
}
}
}

0 comments on commit 6e5c402

Please sign in to comment.