refactor(search): Simplified CSS code

This commit is contained in:
Lucas Larroche 2022-03-13 10:51:03 +07:00
parent a469644b42
commit 1bab87a15b
13 changed files with 24 additions and 31 deletions

View file

@ -226,7 +226,7 @@ input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="
// :not() are needed to add Specificity and avoid !important on padding
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) {
&[type="search"] {
padding-left: calc(var(--form-element-spacing-horizontal) + 1.75rem);
padding-inline-start: calc(var(--form-element-spacing-horizontal) + 1.75rem);
border-radius: 5rem;
background-image: var(--icon-search);
background-position: center left 1.125rem;
@ -235,10 +235,10 @@ input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="
&[aria-invalid] {
@if $enable-important {
padding-left: calc(var(--form-element-spacing-horizontal) + 1.75rem) !important;
padding-inline-start: calc(var(--form-element-spacing-horizontal) + 1.75rem) !important;
}
@else {
padding-left: calc(var(--form-element-spacing-horizontal) + 1.75rem);
padding-inline-start: calc(var(--form-element-spacing-horizontal) + 1.75rem);
}
background-position: center left 1.125rem, center right 0.75rem;
}
@ -265,16 +265,9 @@ input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="
:where(input) {
&:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) {
&[type="search"] {
padding-right: calc(var(--form-element-spacing-horizontal) + 1.75rem);
background-position: center right 1.125rem;
&[aria-invalid] {
@if $enable-important {
padding-right: calc(var(--form-element-spacing-horizontal) + 1.75rem) !important;
}
@else {
padding-right: calc(var(--form-element-spacing-horizontal) + 1.75rem);
}
background-position: center right 1.125rem, center left 0.75rem;
}
}