💄(react) homogenize form fields colors

Based on the QA feedbacks we figured out that form fields were not all
using the exact same greyscale colors.
This commit is contained in:
Nathan Vasse
2023-09-06 16:19:36 +02:00
committed by NathanVss
parent 4c64cb3993
commit 1c45b93a85
21 changed files with 76 additions and 29 deletions

View File

@@ -128,7 +128,8 @@ Here are the custom design tokens defined by the button.
|--------------- |----------------------------- |
| font-weight | Value font weight |
| font-size | Value font size |
| color | Value color |
| value-color | Value color |
| value-color--disabled | Value color when disabled |
| border-radius | Border radius of the input |
| border-radius--hover | Border radius of the input on mouse hover |
| border-radius--focus | Border radius of the input when focused |

View File

@@ -9,7 +9,6 @@
padding: 0 1rem;
gap: 1rem;
cursor: text;
color: var(--c--components--forms-input--color);
box-sizing: border-box;
height: 3.5rem;
@@ -22,7 +21,7 @@
box-sizing: border-box;
outline: 0;
border: none;
color: var(--c--theme--colors--greyscale-800);
color: var(--c--components--forms-input--value-color);
flex-grow: 1;
text-overflow: ellipsis;
background-color: transparent;
@@ -88,11 +87,11 @@
&--disabled {
cursor: default;
color: var(--c--theme--colors--greyscale-400);
border-color: var(--c--theme--colors--greyscale-200);
.c__input, .labelled-box label {
color: var(--c--theme--colors--greyscale-600);
.c__input {
color: var(--c--components--forms-input--value-color--disabled);
}
&:hover {

View File

@@ -90,6 +90,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
label={label}
htmlFor={idToUse.current}
labelAsPlaceholder={labelAsPlaceholder}
disabled={props.disabled}
>
<input
type="text"

View File

@@ -11,7 +11,8 @@ export const tokens = (defaults: DefaultTokens) => ({
"border-color--hover": defaults.theme.colors["greyscale-500"],
"border-color--focus": defaults.theme.colors["primary-600"],
"border-style": "solid",
color: defaults.theme.colors["greyscale-800"],
"label-color--focus": defaults.theme.colors["primary-600"],
"background-color": "white",
"value-color": defaults.theme.colors["greyscale-900"],
"value-color--disabled": defaults.theme.colors["greyscale-800"],
});