Skip to content

Commit

Permalink
fix(@clayui/css): Mixins use Clay Color Functions instead of Sass col…
Browse files Browse the repository at this point in the history
…or functions
  • Loading branch information
pat270 committed Oct 1, 2021
1 parent e7b1abf commit baaddfc
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 29 deletions.
4 changes: 2 additions & 2 deletions packages/clay-css/src/scss/mixins/_alerts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
color: $color;

hr {
border-top-color: darken($border, 5%);
border-top-color: clay-darken($border, 5%);
}

.alert-link {
color: darken($color, 10%);
color: clay-darken($color, 10%);
}
}

Expand Down
8 changes: 2 additions & 6 deletions packages/clay-css/src/scss/mixins/_background.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
button#{$parent} {
&:hover,
&:focus {
background-color: darken($color, 10%) !important;
background-color: clay-darken($color, 10%) !important;
}
}

Expand All @@ -26,11 +26,7 @@
@mixin bg-gradient-variant($parent, $color) {
#{$parent} {
background: $color
linear-gradient(
180deg,
mix(clay-get-fallback($body-bg), $color, 15%),
$color
)
linear-gradient(180deg, clay-mix($body-bg, $color, 15%), $color)
repeat-x !important;
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/clay-css/src/scss/mixins/_badges.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@

@at-root a#{&} {
&:hover {
background-color: darken($bg, 10%);
background-color: clay-darken($bg, 10%);
color: color-yiq($bg);
}

&:focus,
&.focus {
background-color: darken($bg, 10%);
background-color: clay-darken($bg, 10%);
box-shadow: 0 0 0 $badge-focus-width rgba($bg, 0.5);
color: color-yiq($bg);
outline: 0;
Expand Down
19 changes: 11 additions & 8 deletions packages/clay-css/src/scss/mixins/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,10 @@
@mixin button-variant(
$background,
$border,
$hover-background: darken($background, 7.5%),
$hover-border: darken($border, 10%),
$active-background: darken($background, 10%),
$active-border: darken($border, 12.5%)
$hover-background: clay-darken($background, 7.5%),
$hover-border: clay-darken($border, 10%),
$active-background: clay-darken($background, 10%),
$active-border: clay-darken($border, 12.5%)
) {
@include gradient-bg($background);

Expand Down Expand Up @@ -517,13 +517,13 @@
0
0
$btn-focus-width
rgba(mix(color-yiq($background), $border, 15%), 0.5);
rgba(clay-mix(color-yiq($background), $border, 15%), 0.5);
} @else {
box-shadow: 0
0
0
$btn-focus-width
rgba(mix(color-yiq($background), $border, 15%), 0.5);
rgba(clay-mix(color-yiq($background), $border, 15%), 0.5);
}
}

Expand Down Expand Up @@ -556,13 +556,16 @@
0
0
$btn-focus-width
rgba(mix(color-yiq($background), $border, 15%), 0.5);
rgba(
clay-mix(color-yiq($background), $border, 15%),
0.5
);
} @else {
box-shadow: 0
0
0
$btn-focus-width
rgba(mix(color-yiq($background), $border, 15%), 0.5);
rgba(clay-mix(color-yiq($background), $border, 15%), 0.5);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/clay-css/src/scss/mixins/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@

&:checked {
~ .custom-control-label::before {
@include gradient-bg(lighten($color, 10%));
@include gradient-bg(clay-lighten($color, 10%));

border-color: lighten($color, 10%);
border-color: clay-lighten($color, 10%);
}
}

Expand Down
8 changes: 2 additions & 6 deletions packages/clay-css/src/scss/mixins/_gradients.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,9 @@
background: $color
linear-gradient(
180deg,
mix(
clay-mix(
setter(
if(
variable-exists(body-bg),
clay-get-fallback($body-bg),
$cadmin-body-bg
),
if(variable-exists(body-bg), $body-bg, $cadmin-body-bg),
#fff
),
$color,
Expand Down
2 changes: 1 addition & 1 deletion packages/clay-css/src/scss/mixins/_list-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
&.list-group-item-action {
&:hover,
&:focus {
background-color: darken($background, 5%);
background-color: clay-darken($background, 5%);
color: $color;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/clay-css/src/scss/mixins/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// Note: this is not available for cells or rows within `thead` or `tfoot`.

.table-hover {
$hover-background: darken($background, 5%);
$hover-background: clay-darken($background, 5%);

.table-#{$state} {
@include hover() {
Expand Down
2 changes: 1 addition & 1 deletion packages/clay-css/src/scss/mixins/_type.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
a#{$parent} {
&:hover,
&:focus {
color: darken(
color: clay-darken(
$color,
$emphasized-link-hover-darken-percentage
) !important;
Expand Down

0 comments on commit baaddfc

Please sign in to comment.