Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13542 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
  }
245
  .buttons-right span {
246
    margin-left: 5px;
247
  }
248
 
249
  // Place the last button in a bar on the right of the bar
250
  .title + .button:last-child,
251
  > .button + .button:last-child,
252
  > .button.pull-right,
253
  .buttons.pull-right,
254
  .title + .buttons {
255
    position: absolute;
256
    top: 5px;
257
    right: 5px;
258
    bottom: 5px;
259
  }
260
 
261
}
262
 
263
// Default styles for buttons inside of styled bars
264
.bar-light {
265
  .button {
266
    @include button-style($bar-light-bg, $bar-light-border, $bar-light-active-bg, $bar-light-active-border, $bar-light-text);
267
    @include button-clear($bar-light-text, $bar-title-font-size);
268
  }
269
}
270
.bar-stable {
271
  .button {
272
    @include button-style($bar-stable-bg, $bar-stable-border, $bar-stable-active-bg, $bar-stable-active-border, $bar-stable-text);
273
    @include button-clear($bar-stable-text, $bar-title-font-size);
274
  }
275
}
276
.bar-positive {
277
  .button {
278
    @include button-style($bar-positive-bg, $bar-positive-border, $bar-positive-active-bg, $bar-positive-active-border, $bar-positive-text);
279
    @include button-clear(#fff, $bar-title-font-size);
280
  }
281
}
282
.bar-calm {
283
  .button {
284
    @include button-style($bar-calm-bg, $bar-calm-border, $bar-calm-active-bg, $bar-calm-active-border, $bar-calm-text);
285
    @include button-clear(#fff, $bar-title-font-size);
286
  }
287
}
288
.bar-assertive {
289
  .button {
290
    @include button-style($bar-assertive-bg, $bar-assertive-border, $bar-assertive-active-bg, $bar-assertive-active-border, $bar-assertive-text);
291
    @include button-clear(#fff, $bar-title-font-size);
292
  }
293
}
294
.bar-balanced {
295
  .button {
296
    @include button-style($bar-balanced-bg, $bar-balanced-border, $bar-balanced-active-bg, $bar-balanced-active-border, $bar-balanced-text);
297
    @include button-clear(#fff, $bar-title-font-size);
298
  }
299
}
300
.bar-energized {
301
  .button {
302
    @include button-style($bar-energized-bg, $bar-energized-border, $bar-energized-active-bg, $bar-energized-active-border, $bar-energized-text);
303
    @include button-clear(#fff, $bar-title-font-size);
304
  }
305
}
306
.bar-royal {
307
  .button {
308
    @include button-style($bar-royal-bg, $bar-royal-border, $bar-royal-active-bg, $bar-royal-active-border, $bar-royal-text);
309
    @include button-clear(#fff, $bar-title-font-size);
310
  }
311
}
312
.bar-dark {
313
  .button {
314
    @include button-style($bar-dark-bg, $bar-dark-border, $bar-dark-active-bg, $bar-dark-active-border, $bar-dark-text);
315
    @include button-clear(#fff, $bar-title-font-size);
316
  }
317
}
318
 
319
// Header at top
320
.bar-header {
321
  top: 0;
322
  border-top-width: 0;
323
  border-bottom-width: 1px;
324
  &.has-tabs-top{
325
    border-bottom-width: 0px;
326
    background-image: none;
327
  }
328
}
329
 
330
// Footer at bottom
331
.bar-footer {
332
  bottom: 0;
333
  border-top-width: 1px;
334
  border-bottom-width: 0;
335
  background-position: top;
336
 
337
  height: $bar-footer-height;
338
 
339
  &.item-input-inset {
340
    position: absolute;
341
  }
342
}
343
 
344
// Don't render padding if the bar is just for tabs
345
.bar-tabs {
346
  padding: 0;
347
}
348
 
349
.bar-subheader {
350
  top: $bar-height;
351
  display: block;
352
 
353
  height: $bar-subheader-height;
354
}
355
.bar-subfooter {
356
  bottom: $bar-footer-height;
357
  display: block;
358
 
359
  height: $bar-subfooter-height;
360
}
361
 
362
.nav-bar-block {
363
  position: absolute;
364
  top: 0;
365
  right: 0;
366
  left: 0;
367
  z-index: $z-index-bar;
368
}
369
 
370
.bar .back-button.hide,
371
.bar .buttons .hide {
372
  display: none;
373
}