/
_base.scss
168 lines (149 loc) · 3.54 KB
/
_base.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
/*
* Base Button Style
*
* The default values for the .button class
*/
#{$ubtn-namespace} {
color: $ubtn-font-color;
background-color: $ubtn-bgcolor;
border-color: $ubtn-bgcolor;
font-weight: $ubtn-font-weight;
font-size: $ubtn-font-size;
font-family: $ubtn-font-family;
text-decoration: none;
text-align: center;
line-height: $ubtn-height;
height: $ubtn-height;
padding: 0 $ubtn-height;
margin: 0;
display: inline-block;
appearance: none;
cursor: pointer;
border: none;
box-sizing: border-box;
// Compass Mixins
@if $ubtn-use-compass {
@include transition-property(all);
@include transition-duration(.3s);
}
@else {
transition-property: all;
transition-duration:.3s;
}
&:visited {
color: $ubtn-font-color;
}
&:hover,
&:focus {
background-color: lighten($ubtn-bgcolor, 3%);
text-decoration: none;
outline: none;
}
&:active,
&.active,
&.is-active {
text-shadow: 0 1px 0 rgba(255, 255, 255, .3);
text-decoration: none;
background-color: desaturate($ubtn-bgcolor, 10%);
border-color: darken($ubtn-bgcolor, 12%);
color: darken($ubtn-bgcolor, 10%);
// Compass Mixin
@if $ubtn-use-compass {
@include transition-duration(0s);
@include box-shadow(inset 0 1px 3px rgba(0, 0, 0, .2));
}
@else {
transition-duration: 0s;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2);
}
}
/*
* Disabled State
*
* The disabled state uses the class .disabled, is-disabled,
* and the form attribute disabled="disabled".
* The use of !important is only added because this is a state
* that must be applied to all buttons when in a disabled state.
*/
&.disabled,
&.is-disabled,
&:disabled {
top: 0 !important;
background: #EEE !important;
border: 1px solid #DDD !important;
text-shadow: 0 1px 1px rgba(255, 255, 255, 1) !important;
color: #CCC !important;
cursor: default !important;
appearance: none !important;
// Compass Mixin
@if $ubtn-use-compass {
@include box-shadow(0 1px 2px rgba(0, 0, 0, .10) !important);
@include opacity(.8 !important);
}
@else {
box-shadow: none !important;
opacity:.8 !important;
}
}
}
/*
* Base Button Tyography
*
*/
#{$ubtn-namespace}-uppercase {
text-transform: uppercase;
}
#{$ubtn-namespace}-lowercase {
text-transform: lowercase;
}
#{$ubtn-namespace}-capitalize {
text-transform: capitalize;
}
#{$ubtn-namespace}-small-caps {
font-variant: small-caps;
}
#{$ubtn-namespace}-icon-txt-large {
font-size: 36px !important;
}
/*
* Base padding
*
*/
#{$ubtn-namespace}-width-small {
padding: 0 10px !important;
}
/*
* Base Colors
*
* Create colors for buttons
* (.button-primary, .button-secondary, etc.)
*/
@each $ubtn-color in $ubtn-colors {
$ubtn-name: nth($ubtn-color, 1);
$ubtn-background: nth($ubtn-color, 2);
$ubtn-color: nth($ubtn-color, 3);
// Crete class for .button-primary
// and legacy flat .button-primary-flat
#{$ubtn-namespace}-#{$ubtn-name},
#{$ubtn-namespace}-#{$ubtn-name}-flat {
background-color: $ubtn-background;
border-color: $ubtn-background;
color: $ubtn-color;
&:visited {
color: $ubtn-color;
}
&:hover,
&:focus {
background-color: lighten($ubtn-background, 10%);
border-color: lighten($ubtn-background, 10%);
color: $ubtn-color;
}
&:active,
&.active,
&.is-active {
background-color: desaturate($ubtn-background, 10%);
border-color: desaturate($ubtn-background, 10%);
color: darken($ubtn-background, 10%);
}
}
}