Skip to content

Commit

Permalink
fix(material/form-field): insufficient color contrast text to input fill
Browse files Browse the repository at this point in the history
Returns usage of :hover and .mat-focused state layer opacity and updates
_form-field.scss focus-state-layer-opacity value to increase contrast
between text and label colors to bg input fill color.
  • Loading branch information
essjay05 committed Dec 14, 2023
1 parent 8e97abe commit f5d9d76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/material/core/tokens/m2/mat/_form-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $prefix: (mat, form-field);
disabled-select-arrow-color: rgba($on-surface, 0.38),

hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
focus-state-layer-opacity: if($is-dark, 0.24, 0.08),
));
}

Expand Down
7 changes: 7 additions & 0 deletions src/material/form-field/_form-field-focus-overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
tokens-mat-form-field.$prefix, tokens-mat-form-field.get-token-slots()) {
@include token-utils.create-token-slot(background-color, state-layer-color);

.mat-mdc-text-field-wrapper:hover & {
@include token-utils.create-token-slot(opacity, hover-state-layer-opacity);
}

.mat-mdc-form-field.mat-focused & {
@include token-utils.create-token-slot(opacity, focus-state-layer-opacity);
}
}
}
}

0 comments on commit f5d9d76

Please sign in to comment.