Skip to content

Commit 7bf0f29

Browse files
committed
Fixed bootstrap mixin semantic colors
#1669
1 parent 4423545 commit 7bf0f29

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

packages/components/scss/bootstrap_override_mixins_forms.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* stylelint-disable scss/comment-no-empty */
22
// Bootstrap mixin overrides for `bootstrap/scss/mixins/_forms.scss`
3+
@use 'sass:map';
34

45
// Form control focus state
56
//
@@ -38,9 +39,11 @@
3839
// It's primary purpose is to convert the input color value into a dh css
3940
// variable expression. There are a few additional tweaks annotated with
4041
// `DH Customization:`
41-
@mixin form-validation-state($state, $semantic-value, $icon) {
42+
@mixin form-validation-state($state, $bootstrap-value, $icon) {
43+
$semantic-value: map.get($bootstrap-dh-semantic-map, $bootstrap-value) or '';
44+
4245
// DH Customization: Convert semantic value to css variable
43-
$color: var(--dh-color-visual-#{$semantic-value});
46+
$color: var(--dh-color-#{$semantic-value}-bg);
4447

4548
.#{$state}-feedback {
4649
display: none;

packages/components/scss/bootstrap_override_mixins_text_emphasis.scss

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// Bootstrap mixin overrides for `bootstrap/scss/mixins/_text-emphasis.scss`
2+
@use 'sass:map';
3+
4+
@mixin text-emphasis-variant(
5+
$parent,
6+
$bootstrap-value,
7+
$ignore-warning: false
8+
) {
9+
$semantic-value: map.get($bootstrap-dh-semantic-map, $bootstrap-value) or '';
210

3-
@mixin text-emphasis-variant($parent, $semantic-value, $ignore-warning: false) {
411
#{$parent} {
5-
// if $semantic-value = primary then use accent-700
6-
@if $semantic-value == 'accent' {
7-
color: var(--spectrum-#{$semantic-value}-color-700) !important;
8-
} @else {
9-
color: var(--spectrum-#{$semantic-value}-visual-color) !important;
10-
}
12+
color: var(--dh-color-#{$semantic-value}-bg) !important;
1113
}
1214
@if $emphasized-link-hover-darken-percentage != 0 {
1315
a#{$parent} {
1416
@include hover-focus {
15-
color: var(
16-
--spectrum-#{$semantic-value}-background-color-default
17-
) !important;
17+
color: var(--dh-color-#{$semantic-value}-hover-bg) !important;
1818
}
1919
}
2020
}

0 commit comments

Comments
 (0)