/
searchbar.md.scss
122 lines (82 loc) · 2.57 KB
/
searchbar.md.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
@import "./searchbar";
@import "./searchbar.md.vars";
// Material Design Searchbar
// --------------------------------------------------
:host {
--clear-button-color: initial;
--cancel-button-color: #{$searchbar-md-cancel-button-color};
--color: #{$searchbar-md-input-text-color};
--icon-color: #{$searchbar-md-input-search-icon-color};
--background: #{$searchbar-md-input-background-color};
@include padding($searchbar-md-padding-top, $searchbar-md-padding-end, $searchbar-md-padding-bottom, $searchbar-md-padding-start);
background: $searchbar-md-background;
}
// Searchbar Search Icon
// -----------------------------------------
.searchbar-search-icon {
@include position(11px, null, null, 16px);
width: $searchbar-md-input-search-icon-size + 1;
height: $searchbar-md-input-search-icon-size + 1;
}
// Searchbar Cancel Icon
// -----------------------------------------
.searchbar-cancel-button {
@include position(0, null, null, 5px);
background-color: $searchbar-md-cancel-button-background-color;
font-size: $searchbar-md-cancel-button-font-size;
}
// Searchbar Search & Cancel Icon
// -----------------------------------------
.searchbar-search-icon,
.searchbar-cancel-button {
position: absolute;
}
.searchbar-search-icon.activated,
.searchbar-cancel-button.activated {
background-color: transparent;
}
// Searchbar Input Field
// -----------------------------------------
.searchbar-input {
@include padding(6px, 55px);
@include border-radius($searchbar-md-input-border-radius);
@include background-position(start, 8px, center);
height: $searchbar-md-input-height;
font-size: 16px;
font-weight: 400;
line-height: $searchbar-md-input-line-height;
box-shadow: $searchbar-md-input-box-shadow;
}
// Searchbar Clear Input Icon
// -----------------------------------------
.searchbar-clear-button {
@include position(0, 13px, null, null);
@include padding(0);
position: absolute;
height: 100%;
border: 0;
background-color: transparent;
}
.searchbar-clear-button.activated {
background-color: transparent;
}
.searchbar-clear-icon {
width: $searchbar-md-input-clear-icon-size;
height: 100%;
}
// Searchbar Focused
// -----------------------------------------
:host(.searchbar-has-focus) .searchbar-search-icon {
display: block;
}
:host(.searchbar-has-focus) .searchbar-cancel-button {
display: block;
}
:host(.searchbar-has-focus) .searchbar-cancel-button + .searchbar-search-icon {
display: none;
}
// Searchbar in Toolbar
// -----------------------------------------
:host-context(ion-toolbar) {
@include padding(3px);
}