Skip to content

Commit

Permalink
fix(addon-commerce): InputCardGroup fix autofill styles (#8794)
Browse files Browse the repository at this point in the history
  • Loading branch information
waterplea authored Sep 4, 2024
1 parent 1a330a8 commit de3a923
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
:host-context(tui-root._mobile) {
inline-size: @width-mobile;
}

// Increasing specificity to override dark mode appearance
&[tuiAppearance][data-appearance]:has(:-webkit-autofill) {
background: var(--tui-service-autofill-background) !important;
}
}

.t-outline {
Expand Down Expand Up @@ -117,15 +122,13 @@
&:-webkit-autofill {
-webkit-text-fill-color: var(--tui-text-primary) !important;
caret-color: var(--tui-text-primary) !important;
border-color: var(--tui-service-autofill-background) !important;
box-shadow: 0 0 0 100rem var(--tui-service-autofill-background) inset !important;
transition: background-color 600000s 0s;
}

&&&_card {
// @note: (&&&_) it's increasing css cascade priority
&:not(.t-input_hidden),
&:not(.t-input_hidden)::placeholder,
&:not(.t-input_hidden):-webkit-autofill {
&:not(:-webkit-autofill):not(:focus:placeholder-shown),
&.t-input_filled {
caret-color: var(--tui-text-primary);
color: transparent !important;
-webkit-text-fill-color: transparent !important;
Expand Down Expand Up @@ -181,11 +184,13 @@
.transition(all);
.text-overflow();

position: relative;
margin: 1.125rem 1rem;
font: var(--tui-font-text-m);
line-height: 1.25rem;
color: var(--tui-text-secondary);

input:-webkit-autofill ~ &,
&_raised {
font-size: 0.8156rem;
transform: translateY(-0.7em);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[attr.aria-invalid]="!cardPrefilled && !(this.card | tuiMapper: cardValidator)"
[attr.id]="id + '_card'"
[autocomplete]="autocomplete ? 'cc-number' : 'off'"
[class.t-input_hidden]="!card.length && focus()"
[class.t-input_filled]="card.length"
[class.t-input_inert]="cardPrefilled"
[disabled]="disabled()"
[maskito]="maskCard"
Expand Down
1 change: 1 addition & 0 deletions projects/core/styles/theme/appearance/textfield.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
caret-color: var(--tui-text-primary) !important;
border-color: var(--tui-service-autofill-background) !important;
box-shadow: 0 0 0 100rem var(--tui-service-autofill-background) inset !important;
transition: background-color 600000s 0s;
}
}

Expand Down

0 comments on commit de3a923

Please sign in to comment.