Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
15747 anikendra 1
 
2
/**
3
 * Bar (Headers and Footers)
4
 * --------------------------------------------------
5
 */
6
 
7
.bar {
8
  @include display-flex();
9
  @include translate3d(0,0,0);
10
  @include user-select(none);
11
  position: absolute;
12
  right: 0;
13
  left: 0;
14
  z-index: $z-index-bar;
15
 
16
  box-sizing: border-box;
17
  padding: $bar-padding-portrait;
18
 
19
  width: 100%;
20
  height: $bar-height;
21
  border-width: 0;
22
  border-style: solid;
23
  border-top: 1px solid transparent;
24
  border-bottom: 1px solid $bar-default-border;
25
 
26
  background-color: $bar-default-bg;
27
 
28
  /* border-width: 1px will actually create 2 device pixels on retina */
29
  /* this nifty trick sets an actual 1px border on hi-res displays */
30
  background-size: 0;
31
  @media (min--moz-device-pixel-ratio: 1.5),
32
         (-webkit-min-device-pixel-ratio: 1.5),
33
         (min-device-pixel-ratio: 1.5),
34
         (min-resolution: 144dpi),
35
         (min-resolution: 1.5dppx) {
36
    border: none;
37
    background-image: linear-gradient(0deg, $bar-default-border, $bar-default-border 50%, transparent 50%);
38
    background-position: bottom;
39
    background-size: 100% 1px;
40
    background-repeat: no-repeat;
41
  }
42
 
43
  &.bar-clear {
44
    border: none;
45
    background: none;
46
    color: #fff;
47
 
48
    .button {
49
      color: #fff;
50
    }
51
    .title {
52
      color: #fff;
53
    }
54
  }
55
 
56
  &.item-input-inset {
57
    .item-input-wrapper {
58
      margin-top: -1px;
59
 
60
      input {
61
        padding-left: 8px;
62
        width: 94%;
63
        height: 28px;
64
        background: transparent;
65
      }
66
    }
67
  }
68
 
69
  &.bar-light {
70
    @include bar-style($bar-light-bg, $bar-light-border, $bar-light-text);
71
    &.bar-footer{
72
      background-image: linear-gradient(180deg, $bar-light-border, $bar-light-border 50%, transparent 50%);
73
    }
74
  }
75
  &.bar-stable {
76
    @include bar-style($bar-stable-bg, $bar-stable-border, $bar-stable-text);
77
    &.bar-footer{
78
      background-image: linear-gradient(180deg, $bar-stable-border, $bar-stable-border 50%, transparent 50%);
79
    }
80
  }
81
  &.bar-positive {
82
    @include bar-style($bar-positive-bg, $bar-positive-border, $bar-positive-text);
83
    &.bar-footer{
84
      background-image: linear-gradient(180deg, $bar-positive-border, $bar-positive-border 50%, transparent 50%);
85
    }
86
  }
87
  &.bar-calm {
88
    @include bar-style($bar-calm-bg, $bar-calm-border, $bar-calm-text);
89
    &.bar-footer{
90
      background-image: linear-gradient(180deg, $bar-calm-border, $bar-calm-border 50%, transparent 50%);
91
    }
92
  }
93
  &.bar-assertive {
94
    @include bar-style($bar-assertive-bg, $bar-assertive-border, $bar-assertive-text);
95
    &.bar-footer{
96
      background-image: linear-gradient(180deg, $bar-assertive-border, $bar-assertive-border 50%, transparent 50%);
97
    }
98
  }
99
  &.bar-balanced {
100
    @include bar-style($bar-balanced-bg, $bar-balanced-border, $bar-balanced-text);
101
    &.bar-footer{
102
      background-image: linear-gradient(180deg, $bar-balanced-border, $bar-positive-border 50%, transparent 50%);
103
    }
104
  }
105
  &.bar-energized {
106
    @include bar-style($bar-energized-bg, $bar-energized-border, $bar-energized-text);
107
    &.bar-footer{
108
      background-image: linear-gradient(180deg, $bar-energized-border, $bar-energized-border 50%, transparent 50%);
109
    }
110
  }
111
  &.bar-royal {
112
    @include bar-style($bar-royal-bg, $bar-royal-border, $bar-royal-text);
113
    &.bar-footer{
114
      background-image: linear-gradient(180deg, $bar-royal-border, $bar-royal-border 50%, transparent 50%);
115
    }
116
  }
117
  &.bar-dark {
118
    @include bar-style($bar-dark-bg, $bar-dark-border, $bar-dark-text);
119
    &.bar-footer{
120
      background-image: linear-gradient(180deg, $bar-dark-border, $bar-dark-border 50%, transparent 50%);
121
    }
122
  }
123
 
124
  // Title inside of a bar is centered
125
  .title {
126
    position: absolute;
127
 
128
    top: 0;
129
    right: 0;
130
    left: 0;
131
    z-index: $z-index-bar-title;
132
    overflow: hidden;
133
 
134
    margin: 0 10px;
135
 
136
    min-width: 30px;
137
    height: $bar-height - 1;
138
 
139
    text-align: center;
140
 
141
    // Go into ellipsis if too small
142
    text-overflow: ellipsis;
143
    white-space: nowrap;
144
 
145
    font-size: $bar-title-font-size;
146
    font-weight: $headings-font-weight;
147
 
148
    line-height: $bar-height;
149
 
150
    &.title-left {
151
      text-align: left;
152
    }
153
    &.title-right {
154
      text-align: right;
155
    }
156
  }
157
 
158
  .title a {
159
    color: inherit;
160
  }
161
 
162
  .button {
163
    z-index: $z-index-bar-button;
164
    padding: 0 $button-bar-button-padding;
165
    min-width: initial;
166
    min-height: $button-bar-button-height - 1;
167
    font-weight: 400;
168
    font-size: $button-bar-button-font-size;
169
    line-height: $button-bar-button-height;
170
 
171
    &.button-icon:before,
172
    .icon:before,
173
    &.icon:before,
174
    &.icon-left:before,
175
    &.icon-right:before {
176
      padding-right: 2px;
177
      padding-left: 2px;
178
      font-size: $button-bar-button-icon-size;
179
      line-height: $button-bar-button-height;
180
    }
181
 
182
    &.button-icon {
183
      font-size: $bar-title-font-size;
184
      .icon:before,
185
      &:before,
186
      &.icon-left:before,
187
      &.icon-right:before {
188
        vertical-align: top;
189
        font-size: $button-large-icon-size;
190
        line-height: $button-bar-button-height;
191
      }
192
    }
193
    &.button-clear {
194
      padding-right: 2px;
195
      padding-left: 2px;
196
      font-weight: 300;
197
      font-size: $bar-title-font-size;
198
 
199
      .icon:before,
200
      &.icon:before,
201
      &.icon-left:before,
202
      &.icon-right:before {
203
        font-size: $button-large-icon-size;
204
        line-height: $button-bar-button-height;
205
      }
206
    }
207
 
208
    &.back-button {
209
      display: block;
210
      margin-right: 5px;
211
      padding: 0;
212
      white-space: nowrap;
213
      font-weight: 400;
214
    }
215
 
216
    &.back-button.active,
217
    &.back-button.activated {
218
      opacity: 0.2;
219
    }
220
  }
221
 
222
  .button-bar > .button,
223
  .buttons > .button {
224
    min-height: $button-bar-button-height - 1;
225
    line-height: $button-bar-button-height;
226
  }
227
 
228
  .button-bar + .button,
229
  .button + .button-bar {
230
    margin-left: 5px;
231
  }
232
 
233
  // Android 4.4 messes with the display property
234
  .buttons,
235
  .buttons.primary-buttons,
236
  .buttons.secondary-buttons {
237
    display: inherit;
238
  }
239
  .buttons span {
240
    display: inline-block;
241
  }
242
  .buttons-left span {
243
    margin-right: 5px;
244
    display: inherit;
245
  }
246
  .buttons-right span {
247
    margin-left: 5px;
248
    display: inherit;
249
  }
250
 
251
  // Place the last button in a bar on the right of the bar
252
  .title + .button:last-child,
253
  > .button + .button:last-child,
254
  > .button.pull-right,
255
  .buttons.pull-right,
256
  .title + .buttons {
257
    position: absolute;
258
    top: 5px;
259
    right: 5px;
260
    bottom: 5px;
261
  }
262
 
263
}
264
 
265
.platform-android {
266
 
267
  .nav-bar-has-subheader .bar {
268
    background-image: none;
269
  }
270
 
271
  .bar {
272
 
273
    .back-button .icon:before {
274
      font-size: 24px;
275
    }
276
 
277
    .title {
278
      font-size: 19px;
279
      line-height: $bar-height;
280
    }
281
  }
282
 
283
}
284
 
285
// Default styles for buttons inside of styled bars
286
.bar-light {
287
  .button {
288
    @include button-style($bar-light-bg, $bar-light-border, $bar-light-active-bg, $bar-light-active-border, $bar-light-text);
289
    @include button-clear($bar-light-text, $bar-title-font-size);
290
  }
291
}
292
.bar-stable {
293
  .button {
294
    @include button-style($bar-stable-bg, $bar-stable-border, $bar-stable-active-bg, $bar-stable-active-border, $bar-stable-text);
295
    @include button-clear($bar-stable-text, $bar-title-font-size);
296
  }
297
}
298
.bar-positive {
299
  .button {
300
    @include button-style($bar-positive-bg, $bar-positive-border, $bar-positive-active-bg, $bar-positive-active-border, $bar-positive-text);
301
    @include button-clear(#fff, $bar-title-font-size);
302
  }
303
}
304
.bar-calm {
305
  .button {
306
    @include button-style($bar-calm-bg, $bar-calm-border, $bar-calm-active-bg, $bar-calm-active-border, $bar-calm-text);
307
    @include button-clear(#fff, $bar-title-font-size);
308
  }
309
}
310
.bar-assertive {
311
  .button {
312
    @include button-style($bar-assertive-bg, $bar-assertive-border, $bar-assertive-active-bg, $bar-assertive-active-border, $bar-assertive-text);
313
    @include button-clear(#fff, $bar-title-font-size);
314
  }
315
}
316
.bar-balanced {
317
  .button {
318
    @include button-style($bar-balanced-bg, $bar-balanced-border, $bar-balanced-active-bg, $bar-balanced-active-border, $bar-balanced-text);
319
    @include button-clear(#fff, $bar-title-font-size);
320
  }
321
}
322
.bar-energized {
323
  .button {
324
    @include button-style($bar-energized-bg, $bar-energized-border, $bar-energized-active-bg, $bar-energized-active-border, $bar-energized-text);
325
    @include button-clear(#fff, $bar-title-font-size);
326
  }
327
}
328
.bar-royal {
329
  .button {
330
    @include button-style($bar-royal-bg, $bar-royal-border, $bar-royal-active-bg, $bar-royal-active-border, $bar-royal-text);
331
    @include button-clear(#fff, $bar-title-font-size);
332
  }
333
}
334
.bar-dark {
335
  .button {
336
    @include button-style($bar-dark-bg, $bar-dark-border, $bar-dark-active-bg, $bar-dark-active-border, $bar-dark-text);
337
    @include button-clear(#fff, $bar-title-font-size);
338
  }
339
}
340
 
341
// Header at top
342
.bar-header {
343
  top: 0;
344
  border-top-width: 0;
345
  border-bottom-width: 1px;
346
  &.has-tabs-top{
347
    border-bottom-width: 0px;
348
    background-image: none;
349
  }
350
}
351
.tabs-top .bar-header{
352
  border-bottom-width: 0px;
353
  background-image: none;
354
}
355
 
356
// Footer at bottom
357
.bar-footer {
358
  bottom: 0;
359
  border-top-width: 1px;
360
  border-bottom-width: 0;
361
  background-position: top;
362
 
363
  height: $bar-footer-height;
364
 
365
  &.item-input-inset {
366
    position: absolute;
367
  }
368
}
369
 
370
// Don't render padding if the bar is just for tabs
371
.bar-tabs {
372
  padding: 0;
373
}
374
 
375
.bar-subheader {
376
  top: $bar-height;
377
  display: block;
378
 
379
  height: $bar-subheader-height;
380
}
381
.bar-subfooter {
382
  bottom: $bar-footer-height;
383
  display: block;
384
 
385
  height: $bar-subfooter-height;
386
}
387
 
388
.nav-bar-block {
389
  position: absolute;
390
  top: 0;
391
  right: 0;
392
  left: 0;
393
  z-index: $z-index-bar;
394
}
395
 
396
.bar .back-button.hide,
397
.bar .buttons .hide {
398
  display: none;
399
}
400
 
401
.nav-bar-tabs-top .bar {
402
  background-image: none;
403
}
404