Skip to content

Commit

Permalink
feat(styles): update select disabled styles (#3228)
Browse files Browse the repository at this point in the history
Co-authored-by: Alizé Debray <[email protected]>
  • Loading branch information
davidritter-dotcom and alizedebray authored Jul 17, 2024
1 parent c201e80 commit 55c2edc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions packages/styles/src/components/floating-label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

&:disabled {
~ label {
color: forms.$input-disabled-color;
color: var(--post-gray-60);
}
}

Expand Down Expand Up @@ -133,7 +133,7 @@

&:disabled {
~ label {
color: forms.$input-disabled-color;
color: var(--post-gray-60);
}
}

Expand Down
8 changes: 3 additions & 5 deletions packages/styles/src/components/form-select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@
}
}

&:disabled {
@include utilities.high-contrast-mode {
border-color: GrayText !important;
background-color: Field !important;
color: GrayText;
@include utilities.disabled-style {
~ .form-text {
color: var(--post-gray-60);
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/styles/src/components/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ select.form-control-rg:not([size]):not([multiple]) {
border: forms.$input-disabled-border-style;

~ .form-text {
color: forms.$input-disabled-color;
color: var(--post-gray-60);
}

@include utilities.high-contrast-mode {
Expand Down Expand Up @@ -219,7 +219,7 @@ select.form-control-rg:not([size]):not([multiple]) {
margin-bottom: spacing.$size-micro;
}

&:has(+ .form-control[disabled]) {
color: forms.$input-disabled-color;
&:has(+ .form-control[disabled], + .form-select[disabled]) {
color: var(--post-gray-60);
}
}
2 changes: 1 addition & 1 deletion packages/styles/src/mixins/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
@mixin disabled-style($additional-selector: '') {
&:disabled#{$additional-selector} {
pointer-events: none;
color: var(--post-gray-40);
color: var(--post-gray-60);
border-color: var(--post-gray-40);
border-style: dashed;
background-clip: padding-box;
Expand Down
4 changes: 2 additions & 2 deletions packages/styles/src/variables/components/_form-select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
$form-select-border-radius: forms.$input-border-radius;
$form-select-disabled-color: forms.$input-disabled-color;
$form-select-disabled-bg: forms.$input-disabled-bg;
$form-select-disabled-border-color: forms.$input-disabled-border-color;
$form-select-disabled-border-color: color.$gray-40;
$form-select-indicator-color: color.$black;
$form-select-indicator: url('#{icons.get-colored-svg-url('2113', $form-select-indicator-color)}') !default;
$form-select-indicator-disabled: url('#{icons.get-colored-svg-url('2113', $form-select-disabled-color)}') !default;
$form-select-indicator-disabled: url('#{icons.get-colored-svg-url('2113', $form-select-disabled-border-color)}') !default;
$form-select-indicator-hcm-dark: url('#{icons.get-colored-svg-url('2113', color.$white)}') !default;
$form-select-indicator-hcm-light: url('#{icons.get-colored-svg-url('2113', color.$black)}') !default;

Expand Down
4 changes: 2 additions & 2 deletions packages/styles/src/variables/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ $input-line-height-lg: type.$line-height-copy !default;

$input-bg: color.$white !default;
$input-disabled-bg: rgba(var(--post-contrast-color-inverted-rgb), 0.4) !default;
$input-disabled-color: rgba(var(--post-contrast-color-rgb), 0.6); // Design System only
$input-disabled-border-color: color.$gray-40; // Design System only
$input-disabled-color: var(--post-gray-60); // Design System only
$input-disabled-border-color: var(--post-gray-40); // Design System only
$input-disabled-border-style: spacing.$size-line dashed;

$input-color: color.$black !default;
Expand Down

0 comments on commit 55c2edc

Please sign in to comment.