Skip to content

Commit

Permalink
git experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
FrediWa committed Jul 24, 2024
1 parent 580f225 commit 5910fab
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const checkboxGroup = css`
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: transparent;
padding: var(--lumo-space-xs) 0;
--_disabled-value-color: var(--vaadin-input-field-disabled-value-color, var(--lumo-disabled-text-color));
}
:host::before {
Expand All @@ -31,8 +32,8 @@ const checkboxGroup = css`
}
:host([disabled]) [part='label'] {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
color: var(--_disabled-value-color);
-webkit-text-fill-color: var(--_disabled-value-color);
}
:host([focused]:not([disabled])) [part='label'] {
Expand Down
8 changes: 5 additions & 3 deletions packages/checkbox/theme/lumo/vaadin-checkbox-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ registerStyles(
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
--_selection-color: var(--vaadin-selection-color, var(--lumo-primary-color));
--_invalid-background: var(--vaadin-input-field-invalid-background, var(--lumo-error-color-10pct));
--_disabled-background: var(--vaadin-checkbox-disabled-background, var(--lumo-contrast-10pct));
--_disabled-value-color: var(--vaadin-input-field-disabled-value-color, var(--lumo-disabled-text-color));
}
[part='label'] {
Expand Down Expand Up @@ -153,7 +155,7 @@ registerStyles(
}
:host([disabled]) [part='checkbox'] {
background-color: var(--lumo-contrast-10pct);
background-color: var(--_disabled-background);
}
:host([disabled]) [part='checkbox']::after {
Expand All @@ -162,8 +164,8 @@ registerStyles(
:host([disabled]) [part='label'],
:host([disabled]) [part='helper-text'] {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
color: var(--_disabled-value-color);
-webkit-text-fill-color: var(--_disabled-value-color);
}
:host([indeterminate][disabled]) [part='checkbox']::after {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ const customField = css`
/* Disabled */
:host([disabled]) [part='label'] {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
color: var(--_disabled-value-color);
-webkit-text-fill-color: var(--_disabled-value-color);
}
/* Small theme */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ registerStyles(
}
[part~='date'][part~='disabled'] {
color: var(--lumo-disabled-text-color);
color: var(--_disabled-value-color);
}
@media (pointer: coarse) {
Expand All @@ -153,7 +153,7 @@ registerStyles(
/* Disabled */
:host([disabled]) * {
color: var(--lumo-disabled-text-color) !important;
color: var(--_disabled-value-color) !important;
}
`,
{ moduleId: 'lumo-month-calendar' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ describe('input-container', () => {
await visualDiff(div, `${initialState}-disabled`);
});

it('styled disabled', async () => {
div.style.setProperty('--vaadin-input-field-disabled-background', 'black');
div.style.setProperty('--vaadin-input-field-disabled-value-color', 'white');

element.disabled = true;
await visualDiff(div, `${initialState}-styled-disabled`);
});

it('readonly', async () => {
element.readonly = true;
await visualDiff(div, `${initialState}-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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ registerStyles(
--_icon-size: var(--vaadin-input-field-icon-size, var(--lumo-icon-size-m));
--_invalid-background: var(--vaadin-input-field-invalid-background, var(--lumo-error-color-10pct));
--_invalid-hover-highlight: var(--vaadin-input-field-invalid-hover-highlight, var(--lumo-error-color-50pct));
--_disabled-background: var(--vaadin-input-field-disabled-background, var(--lumo-contrast-5pct));
--_disabled-value-color: var(--vaadin-input-field-disabled-value-color, var(--lumo-disabled-text-color));
}
:host([dir='rtl']) {
Expand Down Expand Up @@ -82,12 +84,9 @@ registerStyles(
/* Disabled */
:host([disabled]) {
background-color: var(--lumo-contrast-5pct);
}
:host([disabled]) ::slotted(*) {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
background: var(--_disabled-background);
-webkit-text-fill-color: var(--_disabled-value-color);
color: var(--_disabled-value-color);
}
/* Invalid */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const chip = css`
cursor: var(--lumo-clickable-cursor);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
--_disabled-background: var(--vaadin-input-field-disabled-background, var(--lumo-contrast-5pct));
--_disabled-value-color: var(--vaadin-input-field-disabled-value-color, var(--lumo-disabled-text-color));
}
:host([focused]) [part='remove-button'] {
Expand Down Expand Up @@ -92,8 +94,8 @@ const chip = css`
}
:host([disabled]) [part='label'] {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
color: var(--_disabled-value-color);
-webkit-text-fill-color: var(--_disabled-value-color);
pointer-events: none;
}
`;
Expand Down
8 changes: 5 additions & 3 deletions packages/radio-group/theme/lumo/vaadin-radio-button-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ registerStyles(
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
--_selection-color: var(--vaadin-selection-color, var(--lumo-primary-color));
--_disabled-background: var(--vaadin-radio-button-disabled-background, var(--lumo-contrast-5pct));
--_disabled-value-color: var(--vaadin-input-field-disabled-value-color, var(--lumo-disabled-text-color));
}
:host([has-label]) ::slotted(label) {
Expand Down Expand Up @@ -125,7 +127,7 @@ registerStyles(
:host([disabled]) {
pointer-events: none;
color: var(--lumo-disabled-text-color);
color: var(--_disabled-value-color);
--vaadin-input-field-border-color: var(--lumo-contrast-20pct);
}
Expand All @@ -134,11 +136,11 @@ registerStyles(
}
:host([disabled]) [part='radio'] {
background-color: var(--lumo-contrast-10pct);
background-color: var(--_disabled-background);
}
:host([disabled]) [part='radio']::after {
border-color: var(--lumo-contrast-30pct);
border-color: var(--_disabled-value-color);
}
/* RTL specific styles */
Expand Down
5 changes: 3 additions & 2 deletions packages/radio-group/theme/lumo/vaadin-radio-group-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const radioGroup = css`
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: transparent;
padding: var(--lumo-space-xs) 0;
--_disabled-value-color: var(--vaadin-input-field-disabled-value-color, var(--lumo-disabled-text-color));
}
:host::before {
Expand All @@ -31,8 +32,8 @@ const radioGroup = css`
}
:host([disabled]) [part='label'] {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
color: var(--_disabled-value-color);
-webkit-text-fill-color: var(--_disabled-value-color);
}
:host([focused]:not([readonly])) [part='label'] {
Expand Down
6 changes: 4 additions & 2 deletions packages/vaadin-lumo-styles/mixins/input-field-shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const inputField = css`
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
--_input-height: var(--vaadin-input-field-height, var(--lumo-text-field-size));
--_disabled-background: var(--vaadin-input-field-disabled-background, var(--lumo-contrast-5pct));
--_disabled-value-color: var(--vaadin-input-field-disabled-value-color, var(--lumo-disabled-text-color));
}
:host::before {
Expand Down Expand Up @@ -91,8 +93,8 @@ const inputField = css`
:host([disabled]) [part='label'],
:host([disabled]) [part='input-field'] ::slotted(*) {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
color: var(--_disabled-value-color);
-webkit-text-fill-color: var(--_disabled-value-color);
}
/* Invalid style */
Expand Down

0 comments on commit 5910fab

Please sign in to comment.