jekyll-theme-foundation 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +48 -0
- data/_includes/google-analytics.html +8 -0
- data/_includes/head.html +17 -0
- data/_includes/scripts.html +4 -0
- data/_layouts/default.html +16 -0
- data/_layouts/home.html +5 -0
- data/_layouts/page.html +5 -0
- data/_layouts/post.html +5 -0
- data/_sass/_vendor/normalize-scss/sass/_normalize.scss +3 -0
- data/_sass/_vendor/normalize-scss/sass/normalize/_import-now.scss +11 -0
- data/_sass/_vendor/normalize-scss/sass/normalize/_normalize-mixin.scss +676 -0
- data/_sass/_vendor/normalize-scss/sass/normalize/_variables.scss +36 -0
- data/_sass/_vendor/normalize-scss/sass/normalize/_vertical-rhythm.scss +61 -0
- data/_sass/_vendor/sassy-lists/stylesheets/functions/_contain.scss +31 -0
- data/_sass/_vendor/sassy-lists/stylesheets/functions/_purge.scss +38 -0
- data/_sass/_vendor/sassy-lists/stylesheets/functions/_remove.scss +31 -0
- data/_sass/_vendor/sassy-lists/stylesheets/functions/_replace.scss +46 -0
- data/_sass/_vendor/sassy-lists/stylesheets/functions/_to-list.scss +27 -0
- data/_sass/_vendor/sassy-lists/stylesheets/helpers/_missing-dependencies.scss +25 -0
- data/_sass/_vendor/sassy-lists/stylesheets/helpers/_true.scss +13 -0
- data/_sass/assets/foundation-float.scss +5 -0
- data/_sass/assets/foundation-prototype.scss +3 -0
- data/_sass/assets/foundation-rtl.scss +5 -0
- data/_sass/assets/foundation.scss +3 -0
- data/_sass/jekyll-theme-foundation.scss +5 -0
- data/_sass/scss/_global.scss +249 -0
- data/_sass/scss/components/_accordion-menu.scss +171 -0
- data/_sass/scss/components/_accordion.scss +155 -0
- data/_sass/scss/components/_badge.scss +63 -0
- data/_sass/scss/components/_breadcrumbs.scss +117 -0
- data/_sass/scss/components/_button-group.scss +253 -0
- data/_sass/scss/components/_button.scss +385 -0
- data/_sass/scss/components/_callout.scss +106 -0
- data/_sass/scss/components/_card.scss +129 -0
- data/_sass/scss/components/_close-button.scss +102 -0
- data/_sass/scss/components/_drilldown.scss +142 -0
- data/_sass/scss/components/_dropdown-menu.scss +274 -0
- data/_sass/scss/components/_dropdown.scss +79 -0
- data/_sass/scss/components/_flex-video.scss +1 -0
- data/_sass/scss/components/_flex.scss +117 -0
- data/_sass/scss/components/_float.scss +27 -0
- data/_sass/scss/components/_label.scss +64 -0
- data/_sass/scss/components/_media-object.scss +114 -0
- data/_sass/scss/components/_menu-icon.scss +9 -0
- data/_sass/scss/components/_menu.scss +495 -0
- data/_sass/scss/components/_off-canvas.scss +506 -0
- data/_sass/scss/components/_orbit.scss +196 -0
- data/_sass/scss/components/_pagination.scss +193 -0
- data/_sass/scss/components/_progress-bar.scss +64 -0
- data/_sass/scss/components/_responsive-embed.scss +70 -0
- data/_sass/scss/components/_reveal.scss +180 -0
- data/_sass/scss/components/_slider.scss +137 -0
- data/_sass/scss/components/_sticky.scss +39 -0
- data/_sass/scss/components/_switch.scss +247 -0
- data/_sass/scss/components/_table.scss +330 -0
- data/_sass/scss/components/_tabs.scss +196 -0
- data/_sass/scss/components/_thumbnail.scss +67 -0
- data/_sass/scss/components/_title-bar.scss +84 -0
- data/_sass/scss/components/_tooltip.scss +160 -0
- data/_sass/scss/components/_top-bar.scss +175 -0
- data/_sass/scss/components/_visibility.scss +132 -0
- data/_sass/scss/forms/_checkbox.scss +41 -0
- data/_sass/scss/forms/_error.scss +88 -0
- data/_sass/scss/forms/_fieldset.scss +53 -0
- data/_sass/scss/forms/_forms.scss +34 -0
- data/_sass/scss/forms/_help-text.scss +30 -0
- data/_sass/scss/forms/_input-group.scss +142 -0
- data/_sass/scss/forms/_label.scss +50 -0
- data/_sass/scss/forms/_meter.scss +116 -0
- data/_sass/scss/forms/_progress.scss +94 -0
- data/_sass/scss/forms/_range.scss +149 -0
- data/_sass/scss/forms/_select.scss +86 -0
- data/_sass/scss/forms/_text.scss +179 -0
- data/_sass/scss/foundation.scss +133 -0
- data/_sass/scss/grid/_classes.scss +176 -0
- data/_sass/scss/grid/_column.scss +112 -0
- data/_sass/scss/grid/_flex-grid.scss +259 -0
- data/_sass/scss/grid/_grid.scss +48 -0
- data/_sass/scss/grid/_gutter.scss +82 -0
- data/_sass/scss/grid/_layout.scss +76 -0
- data/_sass/scss/grid/_position.scss +76 -0
- data/_sass/scss/grid/_row.scss +99 -0
- data/_sass/scss/grid/_size.scss +24 -0
- data/_sass/scss/prototype/_arrow.scss +36 -0
- data/_sass/scss/prototype/_border-box.scss +35 -0
- data/_sass/scss/prototype/_border-none.scss +35 -0
- data/_sass/scss/prototype/_bordered.scss +54 -0
- data/_sass/scss/prototype/_box.scss +23 -0
- data/_sass/scss/prototype/_display.scss +50 -0
- data/_sass/scss/prototype/_font-styling.scss +95 -0
- data/_sass/scss/prototype/_list-style-type.scss +95 -0
- data/_sass/scss/prototype/_overflow.scss +72 -0
- data/_sass/scss/prototype/_position.scss +114 -0
- data/_sass/scss/prototype/_prototype.scss +87 -0
- data/_sass/scss/prototype/_relation.scss +157 -0
- data/_sass/scss/prototype/_rotate.scss +31 -0
- data/_sass/scss/prototype/_rounded.scss +54 -0
- data/_sass/scss/prototype/_separator.scss +96 -0
- data/_sass/scss/prototype/_shadow.scss +43 -0
- data/_sass/scss/prototype/_sizing.scss +73 -0
- data/_sass/scss/prototype/_spacing.scss +204 -0
- data/_sass/scss/prototype/_text-decoration.scss +48 -0
- data/_sass/scss/prototype/_text-transformation.scss +48 -0
- data/_sass/scss/prototype/_text-utilities.scss +88 -0
- data/_sass/scss/settings/_settings.scss +869 -0
- data/_sass/scss/typography/_alignment.scss +22 -0
- data/_sass/scss/typography/_base.scss +509 -0
- data/_sass/scss/typography/_helpers.scss +80 -0
- data/_sass/scss/typography/_print.scss +86 -0
- data/_sass/scss/typography/_typography.scss +26 -0
- data/_sass/scss/util/_breakpoint.scss +348 -0
- data/_sass/scss/util/_color.scss +129 -0
- data/_sass/scss/util/_direction.scss +31 -0
- data/_sass/scss/util/_flex.scss +85 -0
- data/_sass/scss/util/_math.scss +72 -0
- data/_sass/scss/util/_mixins.scss +313 -0
- data/_sass/scss/util/_selector.scss +41 -0
- data/_sass/scss/util/_typography.scss +26 -0
- data/_sass/scss/util/_unit.scss +152 -0
- data/_sass/scss/util/_util.scss +14 -0
- data/_sass/scss/util/_value.scss +160 -0
- data/_sass/scss/xy-grid/_cell.scss +169 -0
- data/_sass/scss/xy-grid/_classes.scss +476 -0
- data/_sass/scss/xy-grid/_collapse.scss +74 -0
- data/_sass/scss/xy-grid/_frame.scss +85 -0
- data/_sass/scss/xy-grid/_grid.scss +35 -0
- data/_sass/scss/xy-grid/_gutters.scss +45 -0
- data/_sass/scss/xy-grid/_layout.scss +33 -0
- data/_sass/scss/xy-grid/_position.scss +28 -0
- data/_sass/scss/xy-grid/_xy-grid.scss +51 -0
- data/assets/css/main.scss +5 -0
- data/assets/css/motion-ui.min.css +1 -0
- data/assets/js/foundation.min.js +5 -0
- data/assets/js/motion-ui.min.js +1 -0
- metadata +235 -0
@@ -0,0 +1,253 @@
|
|
1
|
+
// Foundation for Sites by ZURB
|
2
|
+
// foundation.zurb.com
|
3
|
+
// Licensed under MIT Open Source
|
4
|
+
|
5
|
+
////
|
6
|
+
/// @group button-group
|
7
|
+
////
|
8
|
+
|
9
|
+
/// Margin for button groups.
|
10
|
+
/// @type Number
|
11
|
+
$buttongroup-margin: 1rem !default;
|
12
|
+
|
13
|
+
/// Margin between buttons in a button group.
|
14
|
+
/// @type Number
|
15
|
+
$buttongroup-spacing: 1px !default;
|
16
|
+
|
17
|
+
/// Selector for the buttons inside a button group.
|
18
|
+
/// @type String
|
19
|
+
$buttongroup-child-selector: '.button' !default;
|
20
|
+
|
21
|
+
/// Maximum number of buttons that can be in an even-width button group.
|
22
|
+
/// @type Number
|
23
|
+
$buttongroup-expand-max: 6 !default;
|
24
|
+
|
25
|
+
/// Determines if $button-radius is applied to each button or the button group as a whole. Use $global-radius in _settings.scss to change radius.
|
26
|
+
/// @type Boolean
|
27
|
+
$buttongroup-radius-on-each: true !default;
|
28
|
+
|
29
|
+
/// Add styles for a button group container.
|
30
|
+
/// @param {String} $child-selector [$buttongroup-child-selector] - Selector for the buttons inside a button group.
|
31
|
+
/// @param {Number} $spacing [$buttongroup-spacing] - Spacing between buttons in a button group.
|
32
|
+
@mixin button-group(
|
33
|
+
$child-selector: $buttongroup-child-selector,
|
34
|
+
$spacing: $buttongroup-spacing
|
35
|
+
) {
|
36
|
+
@include clearfix;
|
37
|
+
margin-bottom: $buttongroup-margin;
|
38
|
+
|
39
|
+
@if $global-flexbox {
|
40
|
+
display: flex;
|
41
|
+
flex-wrap: nowrap;
|
42
|
+
align-items: stretch;
|
43
|
+
}
|
44
|
+
@else {
|
45
|
+
font-size: 0;
|
46
|
+
}
|
47
|
+
|
48
|
+
#{$child-selector} {
|
49
|
+
margin: 0;
|
50
|
+
margin-#{$global-right}: $spacing;
|
51
|
+
margin-bottom: $spacing;
|
52
|
+
font-size: map-get($button-sizes, default);
|
53
|
+
|
54
|
+
@if $global-flexbox {
|
55
|
+
flex: 0 0 auto;
|
56
|
+
}
|
57
|
+
|
58
|
+
&:last-child {
|
59
|
+
margin-#{$global-right}: 0;
|
60
|
+
}
|
61
|
+
|
62
|
+
@if not $buttongroup-radius-on-each {
|
63
|
+
border-radius: 0;
|
64
|
+
|
65
|
+
&:first-child {
|
66
|
+
border-top-#{$global-left}-radius: $button-radius;
|
67
|
+
border-bottom-#{$global-left}-radius: $button-radius;
|
68
|
+
}
|
69
|
+
|
70
|
+
&:last-child {
|
71
|
+
border-top-#{$global-right}-radius: $button-radius;
|
72
|
+
border-bottom-#{$global-right}-radius: $button-radius;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
/// Creates a full-width button group, making each button equal width.
|
80
|
+
/// @param {String} $selector [$buttongroup-child-selector] - Selector for the buttons inside a button group.
|
81
|
+
/// @param {Number} $spacing [$buttongroup-spacing] - Spacing between buttons in a button group.
|
82
|
+
@mixin button-group-expand(
|
83
|
+
$selector: $buttongroup-child-selector,
|
84
|
+
$spacing: $buttongroup-spacing,
|
85
|
+
$count: null
|
86
|
+
) {
|
87
|
+
@if not $global-flexbox {
|
88
|
+
margin-#{$global-right}: -$spacing;
|
89
|
+
|
90
|
+
&::before,
|
91
|
+
&::after {
|
92
|
+
display: none;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
#{$selector} {
|
97
|
+
@if $global-flexbox {
|
98
|
+
flex: 1 1 0px; // sass-lint:disable-line zero-unit
|
99
|
+
}
|
100
|
+
@else {
|
101
|
+
// One child
|
102
|
+
&:first-child:last-child {
|
103
|
+
width: 100%;
|
104
|
+
}
|
105
|
+
|
106
|
+
// Two or more childreen
|
107
|
+
@for $i from 2 through $buttongroup-expand-max {
|
108
|
+
&:first-child:nth-last-child(#{$i}) {
|
109
|
+
&, &:first-child:nth-last-child(#{$i}) ~ #{$selector} {
|
110
|
+
display: inline-block;
|
111
|
+
width: calc(#{percentage(1 / $i)} - #{$spacing});
|
112
|
+
margin-#{$global-right}: $spacing;
|
113
|
+
|
114
|
+
&:last-child {
|
115
|
+
margin-#{$global-right}: $spacing * -$buttongroup-expand-max;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
/// Stacks the buttons in a button group.
|
125
|
+
/// @param {String} $selector [$buttongroup-child-selector] - Selector for the buttons inside the button group.
|
126
|
+
@mixin button-group-stack(
|
127
|
+
$selector: $buttongroup-child-selector
|
128
|
+
) {
|
129
|
+
@if $global-flexbox {
|
130
|
+
flex-wrap: wrap;
|
131
|
+
}
|
132
|
+
|
133
|
+
#{$selector} {
|
134
|
+
@if $global-flexbox {
|
135
|
+
flex: 0 0 100%;
|
136
|
+
}
|
137
|
+
@else {
|
138
|
+
width: 100%;
|
139
|
+
}
|
140
|
+
|
141
|
+
&:last-child {
|
142
|
+
margin-bottom: 0;
|
143
|
+
}
|
144
|
+
|
145
|
+
|
146
|
+
@if not $buttongroup-radius-on-each {
|
147
|
+
border-radius: 0;
|
148
|
+
|
149
|
+
&:first-child{
|
150
|
+
border-top-#{$global-left}-radius: $global-radius;
|
151
|
+
border-top-#{$global-right}-radius: $global-radius;
|
152
|
+
}
|
153
|
+
|
154
|
+
&:last-child {
|
155
|
+
margin-bottom: 0;
|
156
|
+
border-bottom-#{$global-left}-radius: $global-radius;
|
157
|
+
border-bottom-#{$global-right}-radius: $global-radius;
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
/// Un-stacks the buttons in a button group.
|
165
|
+
/// @param {String} $selector [$buttongroup-child-selector] - Selector for the buttons inside the button group.
|
166
|
+
@mixin button-group-unstack(
|
167
|
+
$selector: $buttongroup-child-selector
|
168
|
+
) {
|
169
|
+
#{$selector} {
|
170
|
+
@if $global-flexbox {
|
171
|
+
flex: 1 1 0px; // sass-lint:disable-line zero-unit
|
172
|
+
}
|
173
|
+
@else {
|
174
|
+
width: auto;
|
175
|
+
}
|
176
|
+
margin-bottom: 0;
|
177
|
+
|
178
|
+
@if not $buttongroup-radius-on-each {
|
179
|
+
&:first-child {
|
180
|
+
border-top-#{$global-left}-radius: $global-radius;
|
181
|
+
border-top-#{$global-right}-radius: 0;
|
182
|
+
border-bottom-#{$global-left}-radius: $global-radius;
|
183
|
+
}
|
184
|
+
|
185
|
+
&:last-child {
|
186
|
+
border-top-#{$global-right}-radius: $global-radius;
|
187
|
+
border-bottom-#{$global-right}-radius: $global-radius;
|
188
|
+
border-bottom-#{$global-left}-radius: 0;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
@mixin foundation-button-group {
|
196
|
+
.button-group {
|
197
|
+
@include button-group;
|
198
|
+
|
199
|
+
// Sizes
|
200
|
+
@each $size, $value in map-remove($button-sizes, default) {
|
201
|
+
&.#{$size} #{$buttongroup-child-selector} {
|
202
|
+
font-size: $value;
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
// Even-width Group
|
207
|
+
&.expanded { @include button-group-expand; }
|
208
|
+
|
209
|
+
// Colors
|
210
|
+
@each $name, $color in $foundation-palette {
|
211
|
+
@if $button-fill != hollow {
|
212
|
+
&.#{$name} #{$buttongroup-child-selector} {
|
213
|
+
@include button-style($color, auto, auto);
|
214
|
+
}
|
215
|
+
}
|
216
|
+
@else {
|
217
|
+
&.#{$name} #{$buttongroup-child-selector} {
|
218
|
+
@include button-hollow;
|
219
|
+
@include button-hollow-style($color);
|
220
|
+
}
|
221
|
+
}
|
222
|
+
}
|
223
|
+
|
224
|
+
&.stacked,
|
225
|
+
&.stacked-for-small,
|
226
|
+
&.stacked-for-medium {
|
227
|
+
@include button-group-stack;
|
228
|
+
}
|
229
|
+
|
230
|
+
&.stacked-for-small {
|
231
|
+
@include breakpoint(medium) {
|
232
|
+
@include button-group-unstack;
|
233
|
+
}
|
234
|
+
}
|
235
|
+
|
236
|
+
&.stacked-for-medium {
|
237
|
+
@include breakpoint(large) {
|
238
|
+
@include button-group-unstack;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
242
|
+
&.stacked-for-small.expanded { // sass-lint:disable-line force-element-nesting
|
243
|
+
@include breakpoint(small only) {
|
244
|
+
display: block;
|
245
|
+
|
246
|
+
#{$buttongroup-child-selector} {
|
247
|
+
display: block;
|
248
|
+
margin-#{$global-right}: 0;
|
249
|
+
}
|
250
|
+
}
|
251
|
+
}
|
252
|
+
}
|
253
|
+
}
|
@@ -0,0 +1,385 @@
|
|
1
|
+
// Foundation for Sites by ZURB
|
2
|
+
// foundation.zurb.com
|
3
|
+
// Licensed under MIT Open Source
|
4
|
+
|
5
|
+
////
|
6
|
+
/// @group button
|
7
|
+
////
|
8
|
+
|
9
|
+
/// Font family for button elements.
|
10
|
+
/// @type Font
|
11
|
+
$button-font-family: inherit !default;
|
12
|
+
|
13
|
+
/// Padding inside buttons.
|
14
|
+
/// @type List
|
15
|
+
$button-padding: 0.85em 1em !default;
|
16
|
+
|
17
|
+
/// Margin around buttons.
|
18
|
+
/// @type List
|
19
|
+
$button-margin: 0 0 $global-margin 0 !default;
|
20
|
+
|
21
|
+
/// Default fill for buttons. Can either be `solid` or `hollow`.
|
22
|
+
/// @type Keyword
|
23
|
+
$button-fill: solid !default;
|
24
|
+
|
25
|
+
/// Default background color for buttons.
|
26
|
+
/// @type Color
|
27
|
+
$button-background: $primary-color !default;
|
28
|
+
|
29
|
+
/// Background color on hover for buttons.
|
30
|
+
/// @type Color
|
31
|
+
$button-background-hover: scale-color($button-background, $lightness: -15%) !default;
|
32
|
+
|
33
|
+
/// Font color for buttons.
|
34
|
+
/// @type List
|
35
|
+
$button-color: $white !default;
|
36
|
+
|
37
|
+
/// Alternative font color for buttons.
|
38
|
+
/// @type List
|
39
|
+
$button-color-alt: $black !default;
|
40
|
+
|
41
|
+
/// Border radius for buttons, defaulted to global-radius.
|
42
|
+
/// @type Number
|
43
|
+
$button-radius: $global-radius !default;
|
44
|
+
|
45
|
+
/// Border width for hollow outline buttons
|
46
|
+
/// @type Number
|
47
|
+
$button-hollow-border-width: 1px !default;
|
48
|
+
|
49
|
+
/// Sizes for buttons.
|
50
|
+
/// @type Map
|
51
|
+
$button-sizes: (
|
52
|
+
tiny: 0.6rem,
|
53
|
+
small: 0.75rem,
|
54
|
+
default: 0.9rem,
|
55
|
+
large: 1.25rem,
|
56
|
+
) !default;
|
57
|
+
|
58
|
+
/// Coloring classes. A map of classes to output in your CSS, like `.secondary`, `.success`, and so on.
|
59
|
+
/// @type Map
|
60
|
+
$button-palette: $foundation-palette !default;
|
61
|
+
|
62
|
+
/// opacity for a disabled button.
|
63
|
+
/// @type List
|
64
|
+
$button-opacity-disabled: 0.25 !default;
|
65
|
+
|
66
|
+
/// Background color lightness on hover for buttons.
|
67
|
+
/// @type Number
|
68
|
+
$button-background-hover-lightness: -20% !default;
|
69
|
+
|
70
|
+
/// Color lightness on hover for hollow buttons.
|
71
|
+
/// @type Number
|
72
|
+
$button-hollow-hover-lightness: -50% !default;
|
73
|
+
|
74
|
+
// Internal: flip from margin-right to margin-left for defaults
|
75
|
+
@if $global-text-direction == 'rtl' {
|
76
|
+
$button-margin: 0 0 $global-margin $global-margin !default;
|
77
|
+
}
|
78
|
+
|
79
|
+
/// transitions for buttons.
|
80
|
+
/// @type List
|
81
|
+
$button-transition: background-color 0.25s ease-out, color 0.25s ease-out !default;
|
82
|
+
|
83
|
+
// TODO: Document button-base() mixin
|
84
|
+
@mixin button-base {
|
85
|
+
@include disable-mouse-outline;
|
86
|
+
display: inline-block;
|
87
|
+
vertical-align: middle;
|
88
|
+
margin: $button-margin;
|
89
|
+
font-family: $button-font-family;
|
90
|
+
|
91
|
+
@if (type-of($button-padding) == 'map') {
|
92
|
+
@each $size, $padding in $button-padding {
|
93
|
+
@include breakpoint($size) {
|
94
|
+
padding: $padding;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
@else {
|
99
|
+
padding: $button-padding;
|
100
|
+
}
|
101
|
+
|
102
|
+
-webkit-appearance: none;
|
103
|
+
border: 1px solid transparent;
|
104
|
+
border-radius: $button-radius;
|
105
|
+
transition: $button-transition;
|
106
|
+
|
107
|
+
font-size: map-get($button-sizes, default);
|
108
|
+
line-height: 1;
|
109
|
+
text-align: center;
|
110
|
+
cursor: pointer;
|
111
|
+
}
|
112
|
+
|
113
|
+
/// Expands a button to make it full-width.
|
114
|
+
/// @param {Boolean} $expand [true] - Set to `true` to enable the expand behavior. Set to `false` to reverse this behavior.
|
115
|
+
@mixin button-expand($expand: true) {
|
116
|
+
@if $expand {
|
117
|
+
display: block;
|
118
|
+
width: 100%;
|
119
|
+
margin-right: 0;
|
120
|
+
margin-left: 0;
|
121
|
+
}
|
122
|
+
@else {
|
123
|
+
display: inline-block;
|
124
|
+
width: auto;
|
125
|
+
margin: $button-margin;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
/// Sets the visual style of a button.
|
130
|
+
/// @param {Color} $background [$button-background] - Background color of the button.
|
131
|
+
/// @param {Color} $background-hover [$button-background-hover] - Background color of the button on hover. Set to `auto` to have the mixin automatically generate a hover color.
|
132
|
+
/// @param {Color} $color [$button-color] - Text color of the button. Set to `auto` to automatically generate a color based on the background color.
|
133
|
+
@mixin button-style(
|
134
|
+
$background: $button-background,
|
135
|
+
$background-hover: $button-background-hover,
|
136
|
+
$color: $button-color,
|
137
|
+
$background-hover-lightness: $button-background-hover-lightness
|
138
|
+
) {
|
139
|
+
@if $color == auto {
|
140
|
+
$color: color-pick-contrast($background, ($button-color, $button-color-alt));
|
141
|
+
}
|
142
|
+
|
143
|
+
@if $background-hover == auto {
|
144
|
+
$background-hover: scale-color($background, $lightness: $background-hover-lightness);
|
145
|
+
}
|
146
|
+
|
147
|
+
background-color: $background;
|
148
|
+
color: $color;
|
149
|
+
|
150
|
+
&:hover, &:focus {
|
151
|
+
background-color: $background-hover;
|
152
|
+
color: $color;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
/// Removes background fill on hover and focus for hollow buttons.
|
157
|
+
@mixin button-hollow {
|
158
|
+
&,
|
159
|
+
&:hover, &:focus {
|
160
|
+
background-color: transparent;
|
161
|
+
}
|
162
|
+
|
163
|
+
&.disabled,
|
164
|
+
&[disabled] {
|
165
|
+
&,
|
166
|
+
&:hover, &:focus {
|
167
|
+
background-color: transparent;
|
168
|
+
}
|
169
|
+
}
|
170
|
+
}
|
171
|
+
|
172
|
+
@mixin button-hollow-style(
|
173
|
+
$color: $button-background,
|
174
|
+
$hover-lightness: $button-hollow-hover-lightness,
|
175
|
+
$border-width: $button-hollow-border-width
|
176
|
+
) {
|
177
|
+
$color-hover: scale-color($color, $lightness: $hover-lightness);
|
178
|
+
|
179
|
+
border: $border-width solid $color;
|
180
|
+
color: $color;
|
181
|
+
|
182
|
+
&:hover, &:focus {
|
183
|
+
border-color: $color-hover;
|
184
|
+
color: $color-hover;
|
185
|
+
&.disabled,
|
186
|
+
&[disabled] {
|
187
|
+
border: $border-width solid $color;
|
188
|
+
color: $color;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
|
193
|
+
/// Adds disabled styles to a button by fading the element, reseting the cursor, and disabling pointer events.
|
194
|
+
/// @param [Color] $background [$button-background] - Background color of the disabled button.
|
195
|
+
/// @param [Color] $color [$button-color] - Text color of the disabled button. Set to `auto` to have the mixin automatically generate a color based on the background color.
|
196
|
+
@mixin button-disabled(
|
197
|
+
$background: $button-background,
|
198
|
+
$color: $button-color
|
199
|
+
) {
|
200
|
+
@if $color == auto {
|
201
|
+
$color: color-pick-contrast($background, ($button-color, $button-color-alt));
|
202
|
+
}
|
203
|
+
|
204
|
+
opacity: $button-opacity-disabled;
|
205
|
+
cursor: not-allowed;
|
206
|
+
|
207
|
+
&, &:hover, &:focus {
|
208
|
+
background-color: $background;
|
209
|
+
color: $color;
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
213
|
+
/// Adds a dropdown arrow to a button.
|
214
|
+
/// @param {Number} $size [0.4em] - Size of the arrow. We recommend using an `em` value so the triangle scales when used inside different sizes of buttons.
|
215
|
+
/// @param {Color} $color [white] - Color of the arrow.
|
216
|
+
/// @param {Number} $offset [$button-padding] - Distance between the arrow and the text of the button. Defaults to whatever the right padding of a button is.
|
217
|
+
@mixin button-dropdown(
|
218
|
+
$size: 0.4em,
|
219
|
+
$color: $white,
|
220
|
+
$offset: get-side($button-padding, right)
|
221
|
+
) {
|
222
|
+
&::after {
|
223
|
+
@include css-triangle($size, $color, down);
|
224
|
+
position: relative;
|
225
|
+
top: 0.4em; // Aligns the arrow with the text of the button
|
226
|
+
|
227
|
+
display: inline-block;
|
228
|
+
float: #{$global-right};
|
229
|
+
margin-#{$global-left}: $offset;
|
230
|
+
}
|
231
|
+
}
|
232
|
+
|
233
|
+
/// Adds all styles for a button. For more granular control over styles, use the individual button mixins.
|
234
|
+
/// @param {Boolean} $expand [false] - Set to `true` to make the button full-width.
|
235
|
+
/// @param {Color} $background [$button-background] - Background color of the button.
|
236
|
+
/// @param {Color} $background-hover [$button-background-hover] - Background color of the button on hover. Set to `auto` to have the mixin automatically generate a hover color.
|
237
|
+
/// @param {Color} $color [$button-color] - Text color of the button. Set to `auto` to automatically generate a color based on the background color.
|
238
|
+
/// @param {Keyword} $style [solid] - Set to `hollow` to create a hollow button. The color defined in `$background` will be used as the primary color of the button.
|
239
|
+
@mixin button(
|
240
|
+
$expand: false,
|
241
|
+
$background: $button-background,
|
242
|
+
$background-hover: $button-background-hover,
|
243
|
+
$color: $button-color,
|
244
|
+
$style: $button-fill
|
245
|
+
) {
|
246
|
+
@include button-base;
|
247
|
+
|
248
|
+
@if $style == solid {
|
249
|
+
@include button-style($background, $background-hover, $color);
|
250
|
+
}
|
251
|
+
@else if $style == hollow {
|
252
|
+
@include button-hollow;
|
253
|
+
@include button-hollow-style($background);
|
254
|
+
}
|
255
|
+
|
256
|
+
@if $expand {
|
257
|
+
@include button-expand;
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
@mixin foundation-button {
|
262
|
+
.button {
|
263
|
+
@include button;
|
264
|
+
|
265
|
+
// Sizes
|
266
|
+
@each $size, $value in map-remove($button-sizes, default) {
|
267
|
+
&.#{$size} {
|
268
|
+
font-size: $value;
|
269
|
+
}
|
270
|
+
}
|
271
|
+
|
272
|
+
&.expanded { @include button-expand; }
|
273
|
+
|
274
|
+
// Colors
|
275
|
+
@each $name, $color in $button-palette {
|
276
|
+
@if $button-fill != hollow {
|
277
|
+
&.#{$name} {
|
278
|
+
@include button-style($color, auto, auto);
|
279
|
+
}
|
280
|
+
}
|
281
|
+
@else {
|
282
|
+
&.#{$name} {
|
283
|
+
@include button-hollow-style($color);
|
284
|
+
}
|
285
|
+
|
286
|
+
&.#{$name}.dropdown::after {
|
287
|
+
border-top-color: $color;
|
288
|
+
}
|
289
|
+
}
|
290
|
+
}
|
291
|
+
|
292
|
+
// Disabled style
|
293
|
+
&.disabled,
|
294
|
+
&[disabled] {
|
295
|
+
@include button-disabled;
|
296
|
+
|
297
|
+
@each $name, $color in $button-palette {
|
298
|
+
&.#{$name} {
|
299
|
+
@include button-disabled($color, auto);
|
300
|
+
}
|
301
|
+
}
|
302
|
+
}
|
303
|
+
|
304
|
+
// Hollow style
|
305
|
+
@if $button-fill != hollow {
|
306
|
+
&.hollow {
|
307
|
+
@include button-hollow;
|
308
|
+
@include button-hollow-style;
|
309
|
+
|
310
|
+
@each $name, $color in $button-palette {
|
311
|
+
&.#{$name} {
|
312
|
+
@include button-hollow-style($color);
|
313
|
+
}
|
314
|
+
}
|
315
|
+
}
|
316
|
+
}
|
317
|
+
|
318
|
+
// Clear style
|
319
|
+
@if $button-fill != clear {
|
320
|
+
&.clear {
|
321
|
+
@include button-hollow;
|
322
|
+
@include button-hollow-style;
|
323
|
+
|
324
|
+
&, &:hover, &:focus {
|
325
|
+
&, &.disabled, &[disabled] {
|
326
|
+
border-color: transparent;
|
327
|
+
}
|
328
|
+
}
|
329
|
+
|
330
|
+
@each $name, $color in $button-palette {
|
331
|
+
&.#{$name} {
|
332
|
+
@include button-hollow-style($color);
|
333
|
+
|
334
|
+
&, &:hover,
|
335
|
+
&:focus {
|
336
|
+
&,
|
337
|
+
&.disabled,
|
338
|
+
&[disabled] {
|
339
|
+
border-color: transparent;
|
340
|
+
}
|
341
|
+
}
|
342
|
+
}
|
343
|
+
}
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
// Dropdown arrow
|
348
|
+
&.dropdown {
|
349
|
+
@include button-dropdown;
|
350
|
+
|
351
|
+
@if $button-fill == hollow {
|
352
|
+
&::after {
|
353
|
+
border-top-color: $button-background;
|
354
|
+
}
|
355
|
+
}
|
356
|
+
|
357
|
+
&.hollow {
|
358
|
+
&::after {
|
359
|
+
border-top-color: $button-background;
|
360
|
+
}
|
361
|
+
|
362
|
+
@each $name, $color in $button-palette {
|
363
|
+
&.#{$name} {
|
364
|
+
&::after {
|
365
|
+
border-top-color: $color;
|
366
|
+
}
|
367
|
+
}
|
368
|
+
}
|
369
|
+
}
|
370
|
+
}
|
371
|
+
|
372
|
+
// Button with dropdown arrow only
|
373
|
+
&.arrow-only::after {
|
374
|
+
top: -0.1em;
|
375
|
+
float: none;
|
376
|
+
margin-#{$global-left}: 0;
|
377
|
+
}
|
378
|
+
}
|
379
|
+
a.button {
|
380
|
+
&:hover,
|
381
|
+
&:focus {
|
382
|
+
text-decoration: none;
|
383
|
+
}
|
384
|
+
}
|
385
|
+
}
|