Repository navigation
Expand file tree
/
Copy pathsearchbar.less
More file actions
93 lines (83 loc) · 1.74 KB
/
Copy pathsearchbar.less
File metadata and controls
93 lines (83 loc) · 1.74 KB
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
/* === Search Bar === */
@searchbarBorderColor: #b4b4b4;
@searchbarSize: 2.2rem;
.searchbar {
padding: 8px 0;
overflow: hidden;
height: @searchbarSize;
.align-items(center);
.searchbar-cancel {
margin-right: -3rem;
width: 2.2rem; //注意,这里比 2.5rem 要小,因为如果位置刚好一样,可能在动画的过程中出现抖动
float: right;
height: 1.4rem;
line-height: 1.4rem;
text-align: center;
transition: all .3s;
opacity: 0;
transform: translate3d(0,0,0);
}
.search-input {
transform: translate3d(0,0,0);
margin-right: 0;
transition: all .3s;
input {
margin: 0;
height: 1.4rem;
}
}
&.searchbar-active {
.searchbar-cancel {
margin-right: 0;
opacity: 1;
+ .search-input {
margin-right: 2.5rem;
}
}
}
}
.search-input {
position: relative;
input {
box-sizing: border-box;
width: 100%;
height: 1.4rem;
display: block;
border: none;
appearance: none;
border-radius: 0.25rem;
font-family: inherit;
color: @color-text;
font-size: 0.7rem;
font-weight: normal;
padding: 0 0.5rem;
background-color: #fff;
border: 1px solid @searchbarBorderColor;
&::-webkit-input-placeholder {
color: @color-text-gray-light;
opacity: 1;
}
}
.icon {
position: absolute;
font-size: 0.9rem;
color: @searchbarBorderColor;
top: 50%;
left: 0.3rem;
transform: translate3D(0,-50%,0);
}
label + input {
padding-left: 1.4rem;
}
}
.bar .searchbar {
margin: 0 -0.5rem;
padding: 0.4rem 0.5rem;
background: rgba(0, 0, 0, .1);
.search-input input {
border: 0;
}
.searchbar-cancel {
color: @color-text-secondary;
}
}