Skip to content

Commit

Permalink
fix: use correct required indicator color when disabled (#7357)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Apr 23, 2024
1 parent 27d27e9 commit e6281fa
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
5 changes: 5 additions & 0 deletions packages/checkbox/test/visual/lumo/checkbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ describe('checkbox', () => {
element.indeterminate = true;
await visualDiff(div, 'disabled-indeterminate');
});

it('required', async () => {
element.required = true;
await visualDiff(div, 'disabled-required');
});
});

describe('readonly', () => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions packages/checkbox/test/visual/material/checkbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ describe('checkbox', () => {
element.indeterminate = true;
await visualDiff(div, 'disabled-indeterminate');
});

it('required', async () => {
element.required = true;
await visualDiff(div, 'disabled-required');
});
});

describe('RTL', () => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions packages/checkbox/theme/lumo/vaadin-checkbox-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ registerStyles(
/* Disabled */
:host([disabled]) {
pointer-events: none;
color: var(--lumo-disabled-text-color);
--vaadin-input-field-border-color: var(--lumo-contrast-20pct);
}
Expand All @@ -156,6 +155,12 @@ registerStyles(
color: var(--lumo-contrast-30pct);
}
:host([disabled]) [part='label'],
:host([disabled]) [part='helper-text'] {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
}
:host([indeterminate][disabled]) [part='checkbox']::after {
background-color: var(--lumo-contrast-30pct);
}
Expand Down Expand Up @@ -296,11 +301,6 @@ registerStyles(
:host(:hover:not([readonly])) [part='helper-text'] {
color: var(--lumo-body-text-color);
}
:host([disabled]) [part='helper-text'] {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
}
`,
{ moduleId: 'lumo-checkbox' },
);
5 changes: 4 additions & 1 deletion packages/checkbox/theme/material/vaadin-checkbox-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,12 @@ registerStyles(
left: 2px;
}
:host([required]:not([disabled])) [part='required-indicator'] {
color: var(--material-secondary-text-color);
}
:host([required]) [part='required-indicator']::after {
content: '*';
color: var(--material-secondary-text-color);
}
:host([invalid]) [part='required-indicator']::after {
Expand Down

0 comments on commit e6281fa

Please sign in to comment.