-
Notifications
You must be signed in to change notification settings - Fork 173
/
Copy path_patterns_search-box.scss
86 lines (72 loc) · 2.16 KB
/
_patterns_search-box.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
@mixin vf-p-search-box {
%search-box-button {
display: block;
height: calc((2 * $spv-nudge + map-get($line-heights, default-text)) - (2 * $bar-thickness)); // side padding + icon width - focus outline width * 2
margin: $bar-thickness 0;
position: relative;
&:hover {
background: inherit;
&:disabled {
cursor: not-allowed;
}
}
& [class*='p-icon'] {
vertical-align: 0; // reset vertical-align, as icon is aligned to the parent container, not the baseline of the text.
&:only-child {
margin-left: -$sph--small;
margin-right: -$sph--small;
}
}
}
.p-search-box {
display: flex;
justify-content: flex-end;
margin-bottom: $input-margin-bottom;
position: relative;
.p-search-box__reset {
@extend %search-box-button;
@extend %transparent-button;
}
.p-search-box__input {
flex: 1 1 100%;
margin-bottom: 0;
padding-right: calc(2 * (2 * $spv-nudge + map-get($line-heights, default-text)));
position: absolute;
right: 0;
&:hover,
&:-webkit-autofill:hover {
background-color: $colors--theme--background-hover !important;
}
&:active,
&:focus,
&:-internal-autofill-selected,
&:-webkit-autofill,
&:-webkit-autofill:focus {
// XXX: remove important once the button {} selector is refactored to use themeing. At the moment, it trumps these.
background-color: $colors--theme--background-active !important;
border-color: $colors--theme--border-high-contrast !important;
}
&::-webkit-search-cancel-button {
-webkit-appearance: none; // stylelint-disable-line property-no-vendor-prefix
}
&:not(:valid) ~ .p-search-box__reset {
display: none;
}
}
.p-search-box__button {
@extend %search-box-button;
@extend %transparent-button;
border-left-style: solid;
border-left-width: 1px;
}
}
%transparent-button {
&,
&:active,
&:focus,
&:hover {
background-color: transparent !important; //XXX: remove important once buttons have been themified
border-width: 0;
}
}
}