2022-10-23 10:47:50 +07:00
|
|
|
@use "sass:map";
|
2022-10-22 13:11:51 +07:00
|
|
|
@use "../settings" as *;
|
2022-10-22 11:44:10 +07:00
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
@if map.get($modules, "forms/input-search") {
|
|
|
|
/**
|
|
|
|
* Input type search
|
|
|
|
*/
|
|
|
|
|
|
|
|
// :not() are needed to add Specificity and avoid !important on padding
|
|
|
|
input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]) {
|
|
|
|
&[type="search"] {
|
|
|
|
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;
|
|
|
|
background-size: 1rem auto;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
|
|
|
&[aria-invalid] {
|
|
|
|
@if $enable-important {
|
|
|
|
padding-inline-start: calc(
|
|
|
|
var(#{$✨}form-element-spacing-horizontal) + 1.75rem
|
|
|
|
) !important;
|
|
|
|
} @else {
|
|
|
|
padding-inline-start: calc(var(#{$✨}form-element-spacing-horizontal) + 1.75rem);
|
|
|
|
}
|
|
|
|
background-position: center left 1.125rem, center right 0.75rem;
|
2022-10-22 11:44:10 +07:00
|
|
|
}
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
&[aria-invalid="false"] {
|
|
|
|
background-image: var(#{$✨}icon-search), var(#{$✨}icon-valid);
|
|
|
|
}
|
2022-10-22 11:44:10 +07:00
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
&[aria-invalid="true"] {
|
|
|
|
background-image: var(#{$✨}icon-search), var(#{$✨}icon-invalid);
|
|
|
|
}
|
2022-10-22 11:44:10 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
[dir="rtl"] {
|
|
|
|
:where(input) {
|
|
|
|
&:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]) {
|
|
|
|
&[type="search"] {
|
|
|
|
background-position: center right 1.125rem;
|
2022-10-22 11:44:10 +07:00
|
|
|
|
2022-10-23 10:47:50 +07:00
|
|
|
&[aria-invalid] {
|
|
|
|
background-position: center right 1.125rem, center left 0.75rem;
|
|
|
|
}
|
2022-10-22 11:44:10 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|