Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/components/input/themes/input.base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@
font-family: var(--ig-font-family);
z-index: 1;

// This is a hack that removes the autofill background and it's essential,
// otherwise the background is on top of the floating label in material theme.
// The !important flag is because themes that defin transition delay on that element are overriding the transition delay hack
// Fix for https://github.com/IgniteUI/igniteui-webcomponents/pull/2298#pullrequestreview-4772572600
&:is(:-webkit-autofill, :autofill) {
transition-property: background-color, color !important;
transition-delay: 99999s !important;
background-clip: text;
-webkit-text-fill-color: var(--input-text-color, currentcolor);
}
Comment thread
desig9stein marked this conversation as resolved.
}

Expand Down
18 changes: 14 additions & 4 deletions src/components/input/themes/shared/input.common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@

$theme: $base;

// The text color is mirrored in a custom property so that autofilled inputs can
// pick it up through `-webkit-text-fill-color`. See input.base.scss
[part~='input'] {
color: var-get($theme, 'idle-text-color');
--input-text-color: #{var-get($theme, 'idle-text-color')};

color: var(--input-text-color);
}

[part='prefix'] {
Expand All @@ -19,7 +23,9 @@ $theme: $base;

[part~='filled'] {
[part~='input'] {
color: var-get($theme, 'filled-text-color');
--input-text-color: #{var-get($theme, 'filled-text-color')};

color: var(--input-text-color);
}

[part='prefix'] {
Expand Down Expand Up @@ -58,15 +64,19 @@ input::-webkit-datetime-edit {
:host(:not([readonly], [disabled]):hover) {
[part~='filled'] {
[part~='input'] {
color: var-get($theme, 'filled-text-hover-color');
--input-text-color: #{var-get($theme, 'filled-text-hover-color')};

color: var(--input-text-color);
}
}
}

:host(:not([readonly], [disabled]):focus-within) {
[part~='filled'] {
[part~='input'] {
color: var-get($theme, 'focused-text-color');
--input-text-color: #{var-get($theme, 'focused-text-color')};

color: var(--input-text-color);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/input/themes/shared/input.material.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ $fs: rem(16px) !default;
}

[part~='input filled'] {
color: var-get($theme, 'filled-text-color');
--input-text-color: #{var-get($theme, 'filled-text-color')};

color: var(--input-text-color);
}

[part='label'] {
Expand Down