forked from dcloudio/mui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bars.scss
312 lines (273 loc) · 7.78 KB
/
bars.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
//
// Bars
// --------------------------------------------------
.#{$namespace}bar {
position: fixed;
right: 0;
left: 0;
z-index: z("bar","bar");
height: $bar-base-height;
padding-right: $bar-side-spacing;
padding-left: $bar-side-spacing;
background-color: $chrome-color;
border-bottom: 0;
@include box-shadow(0 0 1px rgba(0,0,0,.85));
-webkit-backface-visibility: hidden; // Make sure the bar is visible when a modal animates in.
backface-visibility: hidden;
}
//fixed by fxy
.#{$namespace}bar{
.#{$namespace}title{
width: auto;
left: 40px;
right: 40px;
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
}
.#{$namespace}backdrop {
background: none;
}
}
// Modifier class to dock any bar below .#{$namespace}bar-nav
.#{$namespace}bar-header-secondary {
top: $bar-base-height;
}
// Modifier class for footer bars
.#{$namespace}bar-footer {
bottom: 0;
}
// Modifier class to dock any bar above a standard bar
.#{$namespace}bar-footer-secondary {
bottom: $bar-base-height;
}
// Modifier class to dock any bar above a .#{$namespace}bar-tab
.#{$namespace}bar-footer-secondary-tab {
bottom: $bar-tab-height;
}
// Give the footers the correct border
.#{$namespace}bar-footer,
.#{$namespace}bar-footer-secondary,
.#{$namespace}bar-footer-secondary-tab {
border-top: 0;
}
// Nav bar
// --------------------------------------------------
// Bar docked to top of viewport for showing page title and actions
.#{$namespace}bar-nav {
top: 0;
-webkit-box-shadow: 0px 1px 6px #CCC;
box-shadow: 0px 1px 6px #CCC;
~ .#{$namespace}content .#{$namespace}anchor{
display: block;
height: 45px;
margin-top: -45px;
visibility: hidden;
}
&.#{$namespace}bar .#{$namespace}icon{
margin-left: -10px;
margin-right: -10px;
padding-left: 10px;
padding-right: 10px;
}
}
// Centered text in the .#{$namespace}bar-nav
//
// We position the absolutely to make sure the title is always centered
.#{$namespace}title {
position: absolute;
display: block;
width: 100%;
padding: 0;
margin: 0 (-$bar-side-spacing);
font-size: $font-size-default;
font-weight: $font-weight;
line-height: $bar-base-height;
color: #000;
text-align: center;
white-space: nowrap;
}
// Retain specified title color
.#{$namespace}title a {
color: inherit;
}
// Tab bar
// --------------------------------------------------
// Bar docked to bottom and used for primary app navigation
.#{$namespace}bar-tab {
display: table;
bottom: 0;
width: 100%;
height: $bar-tab-height;
padding: 0;
table-layout: fixed;
border-top: 0;
border-bottom: 0;
-webkit-touch-callout: none;//选项卡上禁止长按弹出菜单;
// Navigational tab (Nested to be more specific for the icons in tab-items)
.#{$namespace}tab-item {
display: table-cell;
width: 1%;
height: $bar-tab-height;
color: #929292;
text-align: center;
vertical-align: middle;
//自动处理超出部分的文字;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
// Active states for the tab bar
&.#{$namespace}active {
color: $primary-color;
}
// Tab icon
.#{$namespace}icon {
top: 3px;
width: 24px;
height: 24px;
padding-top: 0;
padding-bottom: 0;
// Make the text smaller if it's used with an icon
~ .#{$namespace}tab-label {
display: block;
font-size: 11px;
//处理超出部分文字;
overflow: hidden;
text-overflow: ellipsis;
}
&:active {
background: none;
}
}
}
}
.#{$namespace}focusin>.#{$namespace}bar-nav,.#{$namespace}focusin>.#{$namespace}bar-header-secondary{
position:absolute;
}
.#{$namespace}focusin>.#{$namespace}bar~.#{$namespace}content{
padding-bottom: 0;
}
// Bars with buttons
// --------------------------------------------------
.#{$namespace}bar .#{$namespace}btn {
position: relative;
top: 7px;
z-index: z("bar","btn"); // Position the buttons on top of .#{$namespace}title
padding: 6px 12px 7px;
margin-top: 0;
font-weight: $font-weight-light;
// Give buttons that are floated left and right side margin
&.#{$namespace}pull-right {
margin-left: $bar-side-spacing;
}
&.#{$namespace}pull-left {
margin-right: $bar-side-spacing;
}
}
// Bars with link buttons (Line the text up with content)
.#{$namespace}bar .#{$namespace}btn-link {
top: 0;
padding: 0;
font-size: 16px;
line-height: $bar-base-height;
color: $primary-color;
border: 0;
&:active,
&.#{$namespace}active {
color: darken($primary-color, 10%);
}
}
// Bars with block buttons
//
// Add proper padding
.#{$namespace}bar .#{$namespace}btn-block {
top: 6px;
padding: 5px 0;
margin-bottom: 0;
font-size: 16px; // Scale down font size to fit in bar.
}
// Nav buttons (Only applicable within bars)
//
// Buttons inside bars that sit closer against the viewport.
.#{$namespace}bar .#{$namespace}btn-nav {
&.#{$namespace}pull-left {
margin-left: -5px;
.#{$namespace}icon-left-nav {
margin-right: -3px;
}
}
&.#{$namespace}pull-right {
margin-right: -5px;
.#{$namespace}icon-right-nav {
margin-left: -3px;
}
}
&:active{
opacity: .3;
//background-color: rgba(0,0,0,.07);
}
}
// Bars with Muiicons
// --------------------------------------------------
.#{$namespace}bar {
.#{$namespace}icon {
position: relative;
z-index: z("bar","icon"); // Position the buttons on top of .#{$namespace}title
padding-top: 10px;
padding-bottom: 10px;
font-size: 24px;
&:active {
opacity: .3;
//background-color: rgba(0,0,0,.07);
}
}
// Vertical center the larger icons in btns.
.#{$namespace}btn .#{$namespace}icon {
top: 1px;
padding: 0;
margin:0;
}
// Handle carets in the titles
.#{$namespace}title .#{$namespace}icon {
padding: 0;
margin:0;
// Specific postioning of the caret icon within a title. Used with popover.js.
&.#{$namespace}icon-caret {
top: 4px;
margin-left: -5px;
}
}
}
// Bars for search forms
// --------------------------------------------------
// Position/size search bar within the bar
.#{$namespace}bar input[type="search"] {
height: 29px;
margin: 6px 0;
}
.#{$namespace}bar .#{$namespace}input-row .#{$namespace}btn{
padding: 12px 10px;
}
.#{$namespace}bar .#{$namespace}search:before{
margin-top: -10px;
}
.#{$namespace}bar .#{$namespace}input-row .#{$namespace}input-clear~.#{$namespace}icon-clear, .#{$namespace}bar .#{$namespace}input-row .#{$namespace}input-speech~.#{$namespace}icon-speech{
top: 0;
right: 12px;
}
.#{$namespace}bar.#{$namespace}bar-header-secondary .#{$namespace}input-row .#{$namespace}input-clear~.#{$namespace}icon-clear, .#{$namespace}bar.#{$namespace}bar-header-secondary .#{$namespace}input-row .#{$namespace}input-speech~.#{$namespace}icon-speech{
top: 0;
right: 0;
}
// Bars with segmented controls
// --------------------------------------------------
// Position the control correctly inside a bar.
.#{$namespace}bar .#{$namespace}segmented-control {
top: 7px;
margin: 0 auto;
width: auto;
}
.#{$namespace}bar.#{$namespace}bar-header-secondary .#{$namespace}segmented-control {
top: 0px;
}