Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13542 anikendra 1
 
2
/**
3
 * Buttons
4
 * --------------------------------------------------
5
 */
6
 
7
.button {
8
  // set the color defaults
9
  @include button-style($button-default-bg, $button-default-border, $button-default-active-bg, $button-default-active-border, $button-default-text);
10
 
11
  position: relative;
12
  display: inline-block;
13
  margin: 0;
14
  padding: 0 $button-padding;
15
 
16
  min-width: ($button-padding * 3) + $button-font-size;
17
  min-height: $button-height + 5px;
18
 
19
  border-width: $button-border-width;
20
  border-style: solid;
21
  border-radius: $button-border-radius;
22
 
23
  vertical-align: top;
24
  text-align: center;
25
 
26
  text-overflow: ellipsis;
27
  font-size: $button-font-size;
28
  line-height: $button-height - $button-border-width + 1px;
29
 
30
  cursor: pointer;
31
 
32
  &:after {
33
    // used to create a larger button "hit" area
34
    position: absolute;
35
    top: -6px;
36
    right: -6px;
37
    bottom: -6px;
38
    left: -6px;
39
    content: ' ';
40
  }
41
 
42
  .icon {
43
    vertical-align: top;
44
    pointer-events: none;
45
  }
46
 
47
  .icon:before,
48
  &.icon:before,
49
  &.icon-left:before,
50
  &.icon-right:before {
51
    display: inline-block;
52
    padding: 0 0 $button-border-width 0;
53
    vertical-align: inherit;
54
    font-size: $button-icon-size;
55
    line-height: $button-height - $button-border-width;
56
    pointer-events: none;
57
  }
58
  &.icon-left:before {
59
    float: left;
60
    padding-right: .2em;
61
    padding-left: 0;
62
  }
63
  &.icon-right:before {
64
    float: right;
65
    padding-right: 0;
66
    padding-left: .2em;
67
  }
68
 
69
  &.button-block, &.button-full {
70
    margin-top: $button-block-margin;
71
    margin-bottom: $button-block-margin;
72
  }
73
 
74
  &.button-light {
75
    @include button-style($button-light-bg, $button-light-border, $button-light-active-bg, $button-light-active-border, $button-light-text);
76
    @include button-clear($button-light-border);
77
    @include button-outline($button-light-border);
78
  }
79
 
80
  &.button-stable {
81
    @include button-style($button-stable-bg, $button-stable-border, $button-stable-active-bg, $button-stable-active-border, $button-stable-text);
82
    @include button-clear($button-stable-border);
83
    @include button-outline($button-stable-border);
84
  }
85
 
86
  &.button-positive {
87
    @include button-style($button-positive-bg, $button-positive-border, $button-positive-active-bg, $button-positive-active-border, $button-positive-text);
88
    @include button-clear($button-positive-bg);
89
    @include button-outline($button-positive-bg);
90
  }
91
 
92
  &.button-calm {
93
    @include button-style($button-calm-bg, $button-calm-border, $button-calm-active-bg, $button-calm-active-border, $button-calm-text);
94
    @include button-clear($button-calm-bg);
95
    @include button-outline($button-calm-bg);
96
  }
97
 
98
  &.button-assertive {
99
    @include button-style($button-assertive-bg, $button-assertive-border, $button-assertive-active-bg, $button-assertive-active-border, $button-assertive-text);
100
    @include button-clear($button-assertive-bg);
101
    @include button-outline($button-assertive-bg);
102
  }
103
 
104
  &.button-balanced {
105
    @include button-style($button-balanced-bg, $button-balanced-border, $button-balanced-active-bg, $button-balanced-active-border, $button-balanced-text);
106
    @include button-clear($button-balanced-bg);
107
    @include button-outline($button-balanced-bg);
108
  }
109
 
110
  &.button-energized {
111
    @include button-style($button-energized-bg, $button-energized-border, $button-energized-active-bg, $button-energized-active-border, $button-energized-text);
112
    @include button-clear($button-energized-bg);
113
    @include button-outline($button-energized-bg);
114
  }
115
 
116
  &.button-royal {
117
    @include button-style($button-royal-bg, $button-royal-border, $button-royal-active-bg, $button-royal-active-border, $button-royal-text);
118
    @include button-clear($button-royal-bg);
119
    @include button-outline($button-royal-bg);
120
  }
121
 
122
  &.button-dark {
123
    @include button-style($button-dark-bg, $button-dark-border, $button-dark-active-bg, $button-dark-active-border, $button-dark-text);
124
    @include button-clear($button-dark-bg);
125
    @include button-outline($button-dark-bg);
126
  }
127
}
128
 
129
.button-small {
130
  padding: 2px $button-small-padding 1px;
131
  min-width: $button-small-height;
132
  min-height: $button-small-height + 2;
133
  font-size: $button-small-font-size;
134
  line-height: $button-small-height - $button-border-width - 1;
135
 
136
  .icon:before,
137
  &.icon:before,
138
  &.icon-left:before,
139
  &.icon-right:before {
140
    font-size: $button-small-icon-size;
141
    line-height: $button-small-icon-size + 3;
142
    margin-top: 3px;
143
  }
144
}
145
 
146
.button-large {
147
  padding: 0 $button-large-padding;
148
  min-width: ($button-large-padding * 3) + $button-large-font-size;
149
  min-height: $button-large-height + 5;
150
  font-size: $button-large-font-size;
151
  line-height: $button-large-height - $button-border-width;
152
 
153
  .icon:before,
154
  &.icon:before,
155
  &.icon-left:before,
156
  &.icon-right:before {
157
    padding-bottom: ($button-border-width * 2);
158
    font-size: $button-large-icon-size;
159
    line-height: $button-large-height - ($button-border-width * 2) - 1;
160
  }
161
}
162
 
163
.button-icon {
164
  @include transition(opacity .1s);
165
  padding: 0 6px;
166
  min-width: initial;
167
  border-color: transparent;
168
  background: none;
169
 
170
  &.button.active,
171
  &.button.activated {
172
    border-color: transparent;
173
    background: none;
174
    box-shadow: none;
175
    opacity: 0.3;
176
  }
177
 
178
  .icon:before,
179
  &.icon:before {
180
    font-size: $button-large-icon-size;
181
  }
182
}
183
 
184
.button-clear {
185
  @include button-clear($button-default-border);
186
  @include transition(opacity .1s);
187
  padding: 0 $button-clear-padding;
188
  max-height: $button-height;
189
  border-color: transparent;
190
  background: none;
191
  box-shadow: none;
192
 
193
  &.active,
194
  &.activated {
195
    opacity: 0.3;
196
  }
197
}
198
 
199
.button-outline {
200
  @include button-outline($button-default-border);
201
  @include transition(opacity .1s);
202
  background: none;
203
  box-shadow: none;
204
}
205
 
206
.padding > .button.button-block:first-child {
207
  margin-top: 0;
208
}
209
 
210
.button-block {
211
  display: block;
212
  clear: both;
213
 
214
  &:after {
215
    clear: both;
216
  }
217
}
218
 
219
.button-full,
220
.button-full > .button {
221
  display: block;
222
  margin-right: 0;
223
  margin-left: 0;
224
  border-right-width: 0;
225
  border-left-width: 0;
226
  border-radius: 0;
227
}
228
 
229
button.button-block,
230
button.button-full,
231
.button-full > button.button,
232
input.button.button-block  {
233
  width: 100%;
234
}
235
 
236
a.button {
237
  text-decoration: none;
238
 
239
  .icon:before,
240
  &.icon:before,
241
  &.icon-left:before,
242
  &.icon-right:before {
243
    margin-top: 2px;
244
  }
245
}
246
 
247
.button.disabled,
248
.button[disabled] {
249
  opacity: .4;
250
  cursor: default !important;
251
  pointer-events: none;
252
}