-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy path_button.scss
More file actions
142 lines (123 loc) · 3.62 KB
/
_button.scss
File metadata and controls
142 lines (123 loc) · 3.62 KB
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
// Forms - Button
//
// Buttons are generally used for interface actions. Suitable for all-purpose
// use. Defaults to primary call-to-action appearance.
//
// :hover - Suble hover state (will not be displayed on touch interfaces)
// :focus - Focus state for users navigating the page using tab keys.
// :active - "Pushed" button state
// .is-disabled - Disabled (non-interactive) button state. Consider removing button from interface if not necessary to avoid confusion.
// .is-loading - AJAX loading animation. Used when loading results inline.
// .-secondary - Should be used if not the main call-to-action on a page.
// .-tertiary - Used to de-emphasize button (for example, a "cancel" option), but still show inline with other fields.
//
// Markup:
// <a class="button {{modifier_class}}">Example Button</a>
//
// Styleguide Forms - Button
.button {
display: inline-block;
clear: both;
background: $blue;
border: 0;
margin: 0;
line-height: 1.3;
padding: 0.55em 1em 0.45em;
cursor: pointer;
color: #fff;
font-family: $font-proxima-nova;
font-weight: $weight-bold;
font-size: $font-medium;
text-align: center;
text-decoration: none;
text-transform: uppercase;
text-shadow: none;
border-radius: $lg-border-radius;
// Fixes styling in Firefox/Safari; non-standard properties so not autoprefixed.
-moz-appearance: none;
-webkit-appearance: none;
// Ensure text wraps to new lines when in an <input> button
white-space: normal;
&:hover {
background: lighten($blue, $color-tint);
}
&:focus {
outline: none;
border: 1px solid $blue;
box-shadow: 0 0 3px $blue;
background: lighten($blue, $color-tint);
}
&:active {
outline: 0;
background: darken($blue, $color-tint);
}
&:link, &:active, &:hover {
// overrides for default <a> styling
color: #fff;
text-decoration: none;
}
// secondary appearance
&.-secondary {
color: #fff;
text-decoration: none;
background: $dark-gray;
font-size: $font-regular;
font-weight: $weight-bold;
&:hover {
background: lighten($off-black, $color-tint);
}
&:active {
background: darken($off-black, $color-tint);
}
}
// tertiary appearance
&.-tertiary {
background: none;
color: $dark-gray;
font-size: $font-regular;
font-weight: $weight-normal;
text-transform: none;
text-decoration: underline;
border: 0;
&:hover {
color: $off-black;
background-color: none;
text-decoration: underline;
}
&:active {
background-color: none;
}
}
// disabled state
&[disabled], &.is-disabled {
background: $light-gray;
color: lighten($light-gray, 10%);
cursor: default;
&:hover {
background: $light-gray;
}
&:active {
background: $light-gray;
color: lighten($light-gray, 10%);
}
}
&.is-loading, &.is-loading:hover, &.is-loading:active {
position: relative;
color: $light-gray;
color: transparent;
background: #eee data-url($data-spinner-svg) no-repeat center center;
background-size: 32px;
box-shadow: none;
cursor: default;
user-select: none;
.modernizr-no-smil &, .modernizr-no-smil &:hover, .modernizr-no-smil &:active {
// If no support for animated SVG, use 32px animated gif.
background-image: forge-asset-url("images/fallbacks/spinner.gif");
}
.modernizr-no-rgba &, .modernizr-no-rgba &:hover, .modernizr-no-rgba &:active {
// If no support for text color:transparent, hide image and lighten text.
color: $light-gray;
background-image: none;
}
}
}