hamburgers 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.csscomb.dist.json +302 -0
- data/.editorconfig +12 -0
- data/.gitignore +5 -0
- data/.npmignore +11 -0
- data/CHANGELOG.md +63 -0
- data/Gemfile +3 -0
- data/LICENSE +9 -0
- data/README.md +246 -0
- data/_sass/hamburgers/_base.scss +69 -0
- data/_sass/hamburgers/hamburgers.scss +107 -0
- data/_sass/hamburgers/types/_3dx-r.scss +35 -0
- data/_sass/hamburgers/types/_3dx.scss +35 -0
- data/_sass/hamburgers/types/_3dy-r.scss +35 -0
- data/_sass/hamburgers/types/_3dy.scss +35 -0
- data/_sass/hamburgers/types/_arrow-r.scss +16 -0
- data/_sass/hamburgers/types/_arrow.scss +16 -0
- data/_sass/hamburgers/types/_arrowalt-r.scss +36 -0
- data/_sass/hamburgers/types/_arrowalt.scss +36 -0
- data/_sass/hamburgers/types/_boring.scss +30 -0
- data/_sass/hamburgers/types/_collapse-r.scss +47 -0
- data/_sass/hamburgers/types/_collapse.scss +47 -0
- data/_sass/hamburgers/types/_elastic-r.scss +41 -0
- data/_sass/hamburgers/types/_elastic.scss +41 -0
- data/_sass/hamburgers/types/_emphatic-r.scss +53 -0
- data/_sass/hamburgers/types/_emphatic.scss +53 -0
- data/_sass/hamburgers/types/_slider-r.scss +38 -0
- data/_sass/hamburgers/types/_slider.scss +38 -0
- data/_sass/hamburgers/types/_spin-r.scss +43 -0
- data/_sass/hamburgers/types/_spin.scss +43 -0
- data/_sass/hamburgers/types/_spring-r.scss +47 -0
- data/_sass/hamburgers/types/_spring.scss +44 -0
- data/_sass/hamburgers/types/_squeeze.scss +43 -0
- data/_sass/hamburgers/types/_stand-r.scss +45 -0
- data/_sass/hamburgers/types/_stand.scss +45 -0
- data/_sass/hamburgers/types/_vortex-r.scss +48 -0
- data/_sass/hamburgers/types/_vortex.scss +48 -0
- data/bower.json +40 -0
- data/bs-config.js +16 -0
- data/config.postcss.json +6 -0
- data/dist/example.html +203 -0
- data/dist/hamburgers.css +626 -0
- data/dist/hamburgers.min.css +7 -0
- data/gulpfile.js +60 -0
- data/hamburgers.gemspec +17 -0
- data/lib/hamburgers.rb +17 -0
- data/lib/hamburgers/version.rb +3 -0
- data/package.json +53 -0
- data/yarn.lock +3653 -0
- metadata +94 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e5e3c354d470f0053a2d02c4fd2dbc89c767d54f
|
4
|
+
data.tar.gz: 17731257f2a6905a7032cbe3935163c275272c35
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6150314fc6babd08835e93f03933843e97fbc681b06f19874b56261981948da329b834c7b17366d59583c21c18a8e3465e29938869adfcde613163ae43b99e9d
|
7
|
+
data.tar.gz: 750772e291e49ec7867423d7230e33b427348f0859250eba3927375283b05e12cda6bbd7f4aaa78f1f9f0ab5fbc00c3f687181001f7cf8cec7d6b691fc16ae63
|
data/.csscomb.dist.json
ADDED
@@ -0,0 +1,302 @@
|
|
1
|
+
{
|
2
|
+
"exclude": [
|
3
|
+
".git/**",
|
4
|
+
"node_modules/**",
|
5
|
+
"bower_components/**"
|
6
|
+
],
|
7
|
+
"always-semicolon": true,
|
8
|
+
"color-case": "lower",
|
9
|
+
"color-shorthand": true,
|
10
|
+
"element-case": "lower",
|
11
|
+
"eof-newline": true,
|
12
|
+
"leading-zero": false,
|
13
|
+
"remove-empty-rulesets": true,
|
14
|
+
"unitless-zero": true,
|
15
|
+
"sort-order-fallback": "abc",
|
16
|
+
"sort-order": [
|
17
|
+
"font",
|
18
|
+
"font-family",
|
19
|
+
"font-size",
|
20
|
+
"font-weight",
|
21
|
+
"font-style",
|
22
|
+
"font-variant",
|
23
|
+
"font-size-adjust",
|
24
|
+
"font-stretch",
|
25
|
+
"font-effect",
|
26
|
+
"font-emphasize",
|
27
|
+
"font-emphasize-position",
|
28
|
+
"font-emphasize-style",
|
29
|
+
"font-smooth",
|
30
|
+
"line-height"
|
31
|
+
"position",
|
32
|
+
"z-index",
|
33
|
+
"top",
|
34
|
+
"right",
|
35
|
+
"bottom",
|
36
|
+
"left"
|
37
|
+
"display",
|
38
|
+
"visibility",
|
39
|
+
"float",
|
40
|
+
"clear",
|
41
|
+
"overflow",
|
42
|
+
"overflow-x",
|
43
|
+
"overflow-y",
|
44
|
+
"-ms-overflow-x",
|
45
|
+
"-ms-overflow-y",
|
46
|
+
"clip",
|
47
|
+
"zoom",
|
48
|
+
"flex-direction",
|
49
|
+
"flex-order",
|
50
|
+
"flex-pack",
|
51
|
+
"flex-align"
|
52
|
+
"-webkit-box-sizing",
|
53
|
+
"-moz-box-sizing",
|
54
|
+
"box-sizing",
|
55
|
+
"width",
|
56
|
+
"min-width",
|
57
|
+
"max-width",
|
58
|
+
"height",
|
59
|
+
"min-height",
|
60
|
+
"max-height",
|
61
|
+
"margin",
|
62
|
+
"margin-top",
|
63
|
+
"margin-right",
|
64
|
+
"margin-bottom",
|
65
|
+
"margin-left",
|
66
|
+
"padding",
|
67
|
+
"padding-top",
|
68
|
+
"padding-right",
|
69
|
+
"padding-bottom",
|
70
|
+
"padding-left"
|
71
|
+
"table-layout",
|
72
|
+
"empty-cells",
|
73
|
+
"caption-side",
|
74
|
+
"border-spacing",
|
75
|
+
"border-collapse",
|
76
|
+
"list-style",
|
77
|
+
"list-style-position",
|
78
|
+
"list-style-type",
|
79
|
+
"list-style-image"
|
80
|
+
"content",
|
81
|
+
"quotes",
|
82
|
+
"counter-reset",
|
83
|
+
"counter-increment",
|
84
|
+
"resize",
|
85
|
+
"cursor",
|
86
|
+
"-webkit-user-select",
|
87
|
+
"-moz-user-select",
|
88
|
+
"-ms-user-select",
|
89
|
+
"user-select",
|
90
|
+
"nav-index",
|
91
|
+
"nav-up",
|
92
|
+
"nav-right",
|
93
|
+
"nav-down",
|
94
|
+
"nav-left",
|
95
|
+
"-webkit-transition",
|
96
|
+
"-moz-transition",
|
97
|
+
"-ms-transition",
|
98
|
+
"-o-transition",
|
99
|
+
"transition",
|
100
|
+
"-webkit-transition-delay",
|
101
|
+
"-moz-transition-delay",
|
102
|
+
"-ms-transition-delay",
|
103
|
+
"-o-transition-delay",
|
104
|
+
"transition-delay",
|
105
|
+
"-webkit-transition-timing-function",
|
106
|
+
"-moz-transition-timing-function",
|
107
|
+
"-ms-transition-timing-function",
|
108
|
+
"-o-transition-timing-function",
|
109
|
+
"transition-timing-function",
|
110
|
+
"-webkit-transition-duration",
|
111
|
+
"-moz-transition-duration",
|
112
|
+
"-ms-transition-duration",
|
113
|
+
"-o-transition-duration",
|
114
|
+
"transition-duration",
|
115
|
+
"-webkit-transition-property",
|
116
|
+
"-moz-transition-property",
|
117
|
+
"-ms-transition-property",
|
118
|
+
"-o-transition-property",
|
119
|
+
"transition-property",
|
120
|
+
"-webkit-transform",
|
121
|
+
"-moz-transform",
|
122
|
+
"-ms-transform",
|
123
|
+
"-o-transform",
|
124
|
+
"transform",
|
125
|
+
"-webkit-transform-origin",
|
126
|
+
"-moz-transform-origin",
|
127
|
+
"-ms-transform-origin",
|
128
|
+
"-o-transform-origin",
|
129
|
+
"transform-origin",
|
130
|
+
"-webkit-animation",
|
131
|
+
"-moz-animation",
|
132
|
+
"-ms-animation",
|
133
|
+
"-o-animation",
|
134
|
+
"animation",
|
135
|
+
"-webkit-animation-name",
|
136
|
+
"-moz-animation-name",
|
137
|
+
"-ms-animation-name",
|
138
|
+
"-o-animation-name",
|
139
|
+
"animation-name",
|
140
|
+
"-webkit-animation-duration",
|
141
|
+
"-moz-animation-duration",
|
142
|
+
"-ms-animation-duration",
|
143
|
+
"-o-animation-duration",
|
144
|
+
"animation-duration",
|
145
|
+
"-webkit-animation-play-state",
|
146
|
+
"-moz-animation-play-state",
|
147
|
+
"-ms-animation-play-state",
|
148
|
+
"-o-animation-play-state",
|
149
|
+
"animation-play-state",
|
150
|
+
"-webkit-animation-timing-function",
|
151
|
+
"-moz-animation-timing-function",
|
152
|
+
"-ms-animation-timing-function",
|
153
|
+
"-o-animation-timing-function",
|
154
|
+
"animation-timing-function",
|
155
|
+
"-webkit-animation-delay",
|
156
|
+
"-moz-animation-delay",
|
157
|
+
"-ms-animation-delay",
|
158
|
+
"-o-animation-delay",
|
159
|
+
"animation-delay",
|
160
|
+
"-webkit-animation-iteration-count",
|
161
|
+
"-moz-animation-iteration-count",
|
162
|
+
"-ms-animation-iteration-count",
|
163
|
+
"-o-animation-iteration-count",
|
164
|
+
"animation-iteration-count",
|
165
|
+
"-webkit-animation-direction",
|
166
|
+
"-moz-animation-direction",
|
167
|
+
"-ms-animation-direction",
|
168
|
+
"-o-animation-direction",
|
169
|
+
"animation-direction",
|
170
|
+
"text-align",
|
171
|
+
"-webkit-text-align-last",
|
172
|
+
"-moz-text-align-last",
|
173
|
+
"-ms-text-align-last",
|
174
|
+
"text-align-last",
|
175
|
+
"vertical-align",
|
176
|
+
"white-space",
|
177
|
+
"text-decoration",
|
178
|
+
"text-emphasis",
|
179
|
+
"text-emphasis-color",
|
180
|
+
"text-emphasis-style",
|
181
|
+
"text-emphasis-position",
|
182
|
+
"text-indent",
|
183
|
+
"-ms-text-justify",
|
184
|
+
"text-justify",
|
185
|
+
"letter-spacing",
|
186
|
+
"word-spacing",
|
187
|
+
"-ms-writing-mode",
|
188
|
+
"text-outline",
|
189
|
+
"text-transform",
|
190
|
+
"text-wrap",
|
191
|
+
"text-overflow",
|
192
|
+
"-ms-text-overflow",
|
193
|
+
"text-overflow-ellipsis",
|
194
|
+
"text-overflow-mode",
|
195
|
+
"-ms-word-wrap",
|
196
|
+
"word-wrap",
|
197
|
+
"word-break",
|
198
|
+
"-ms-word-break",
|
199
|
+
"-moz-tab-size",
|
200
|
+
"-o-tab-size",
|
201
|
+
"tab-size",
|
202
|
+
"-webkit-hyphens",
|
203
|
+
"-moz-hyphens",
|
204
|
+
"hyphens",
|
205
|
+
"pointer-events"
|
206
|
+
"opacity",
|
207
|
+
"filter:progid:DXImageTransform.Microsoft.Alpha(Opacity",
|
208
|
+
"-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha",
|
209
|
+
"-ms-interpolation-mode",
|
210
|
+
"color",
|
211
|
+
"border",
|
212
|
+
"border-width",
|
213
|
+
"border-style",
|
214
|
+
"border-color",
|
215
|
+
"border-top",
|
216
|
+
"border-top-width",
|
217
|
+
"border-top-style",
|
218
|
+
"border-top-color",
|
219
|
+
"border-right",
|
220
|
+
"border-right-width",
|
221
|
+
"border-right-style",
|
222
|
+
"border-right-color",
|
223
|
+
"border-bottom",
|
224
|
+
"border-bottom-width",
|
225
|
+
"border-bottom-style",
|
226
|
+
"border-bottom-color",
|
227
|
+
"border-left",
|
228
|
+
"border-left-width",
|
229
|
+
"border-left-style",
|
230
|
+
"border-left-color",
|
231
|
+
"-webkit-border-radius",
|
232
|
+
"-moz-border-radius",
|
233
|
+
"border-radius",
|
234
|
+
"-webkit-border-top-left-radius",
|
235
|
+
"-moz-border-radius-topleft",
|
236
|
+
"border-top-left-radius",
|
237
|
+
"-webkit-border-top-right-radius",
|
238
|
+
"-moz-border-radius-topright",
|
239
|
+
"border-top-right-radius",
|
240
|
+
"-webkit-border-bottom-right-radius",
|
241
|
+
"-moz-border-radius-bottomright",
|
242
|
+
"border-bottom-right-radius",
|
243
|
+
"-webkit-border-bottom-left-radius",
|
244
|
+
"-moz-border-radius-bottomleft",
|
245
|
+
"border-bottom-left-radius",
|
246
|
+
"-webkit-border-image",
|
247
|
+
"-moz-border-image",
|
248
|
+
"-o-border-image",
|
249
|
+
"border-image",
|
250
|
+
"-webkit-border-image-source",
|
251
|
+
"-moz-border-image-source",
|
252
|
+
"-o-border-image-source",
|
253
|
+
"border-image-source",
|
254
|
+
"-webkit-border-image-slice",
|
255
|
+
"-moz-border-image-slice",
|
256
|
+
"-o-border-image-slice",
|
257
|
+
"border-image-slice",
|
258
|
+
"-webkit-border-image-width",
|
259
|
+
"-moz-border-image-width",
|
260
|
+
"-o-border-image-width",
|
261
|
+
"border-image-width",
|
262
|
+
"-webkit-border-image-outset",
|
263
|
+
"-moz-border-image-outset",
|
264
|
+
"-o-border-image-outset",
|
265
|
+
"border-image-outset",
|
266
|
+
"-webkit-border-image-repeat",
|
267
|
+
"-moz-border-image-repeat",
|
268
|
+
"-o-border-image-repeat",
|
269
|
+
"border-image-repeat",
|
270
|
+
"outline",
|
271
|
+
"outline-width",
|
272
|
+
"outline-style",
|
273
|
+
"outline-color",
|
274
|
+
"outline-offset",
|
275
|
+
"background",
|
276
|
+
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader",
|
277
|
+
"background-color",
|
278
|
+
"background-image",
|
279
|
+
"background-repeat",
|
280
|
+
"background-attachment",
|
281
|
+
"background-position",
|
282
|
+
"background-position-x",
|
283
|
+
"-ms-background-position-x",
|
284
|
+
"background-position-y",
|
285
|
+
"-ms-background-position-y",
|
286
|
+
"-webkit-background-clip",
|
287
|
+
"-moz-background-clip",
|
288
|
+
"background-clip",
|
289
|
+
"background-origin",
|
290
|
+
"-webkit-background-size",
|
291
|
+
"-moz-background-size",
|
292
|
+
"-o-background-size",
|
293
|
+
"background-size",
|
294
|
+
"box-decoration-break",
|
295
|
+
"-webkit-box-shadow",
|
296
|
+
"-moz-box-shadow",
|
297
|
+
"box-shadow",
|
298
|
+
"filter:progid:DXImageTransform.Microsoft.gradient",
|
299
|
+
"-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient",
|
300
|
+
"text-shadow"
|
301
|
+
]
|
302
|
+
}
|
data/.editorconfig
ADDED
data/.gitignore
ADDED
data/.npmignore
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
Changelog for Hamburgers.
|
4
|
+
|
5
|
+
## [0.6.0] - 11/22/2016
|
6
|
+
### Fixed
|
7
|
+
- Fix `spin-r`’s `.is-active::after` rotation. See https://github.com/jonsuh/hamburgers/issues/28.
|
8
|
+
|
9
|
+
## [0.5.0] - 04/04/2016
|
10
|
+
### Fixed
|
11
|
+
- `Error: Import directives may not be used within control directives or mixins.` in certain cases like when compiling with Ruby Sass.
|
12
|
+
Solution: `@import` all available types and instead nest Sass for each type in `@if` directive which checks to see if the type exists in `$hamburger-types`. e.g.:
|
13
|
+
```scss
|
14
|
+
@if index($hamburger-types, 3dx) {
|
15
|
+
.hamburger--3dx {
|
16
|
+
}
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
20
|
+
## [0.4.0] - 03/28/2016
|
21
|
+
### Improved
|
22
|
+
- Customize the including/excluding of hamburger types in settings as `$hamburger-types` Sass list (e.g. If someone includes Hamburgers via npm or Bower, they don’t have to modify the source files in `node_modules` or `bower_components`.)
|
23
|
+
|
24
|
+
## [0.3.0] - 03/07/2016
|
25
|
+
### Fixed
|
26
|
+
- Top positioning bug for Elastic and Slider ([#13fa295](https://github.com/jonsuh/hamburgers/commit/13fa2958ad18a2e48763824d3a68fd18b03ec274)).
|
27
|
+
|
28
|
+
### Added
|
29
|
+
- 4 hamburger types (with reverse variants)
|
30
|
+
|
31
|
+
```
|
32
|
+
hamburger--3dx
|
33
|
+
hamburger--3dx-r
|
34
|
+
hamburger--3dy
|
35
|
+
hamburger--3dy-r
|
36
|
+
hamburger--spring
|
37
|
+
hamburger--spring-r
|
38
|
+
hamburger--stand
|
39
|
+
hamburger--stand-r
|
40
|
+
```
|
41
|
+
|
42
|
+
## [0.2.0] - 03/04/2016
|
43
|
+
### Added
|
44
|
+
- Supports and favors more accessible and semantic markup:
|
45
|
+
|
46
|
+
```
|
47
|
+
<button class="hamburger" type="button">
|
48
|
+
<span class="hamburger-box">
|
49
|
+
<span class="hamburger-inner"></span>
|
50
|
+
</span>
|
51
|
+
</button>
|
52
|
+
```
|
53
|
+
|
54
|
+
## [0.1.6] - 03/02/2016
|
55
|
+
### Added
|
56
|
+
- [Bower](http://bower.io/) support.
|
57
|
+
|
58
|
+
## [0.1.5] - 03/02/2016
|
59
|
+
### Added
|
60
|
+
- Ability to customize `border-radius` of hamburger layers.
|
61
|
+
|
62
|
+
## [0.1.3] - 03/02/2016
|
63
|
+
- Public release.
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Jonathan Suh <hello@jonsuh.com> (jonsuh.com)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,246 @@
|
|
1
|
+
# Hamburgers
|
2
|
+
|
3
|
+
Hamburgers is a collection of tasty CSS-animated hamburger icons. Also included is the source as a [Sass](#sass) library. It’s modular and customizable, so cook up your own hamburger.
|
4
|
+
|
5
|
+
![](http://i.imgur.com/t7cUjDu.gif)
|
6
|
+
|
7
|
+
### Table of Contents
|
8
|
+
|
9
|
+
- [Usage](#usage)
|
10
|
+
- [Customization](#customization)
|
11
|
+
- [Accessibility](#accessibility)
|
12
|
+
- [Browser Support](#browser-support)
|
13
|
+
|
14
|
+
## Usage
|
15
|
+
|
16
|
+
1. [Download](https://github.com/jonsuh/hamburgers/blob/master/dist/hamburgers.css) and include the CSS in the `<head>` of your site:
|
17
|
+
|
18
|
+
```html
|
19
|
+
<link href="dist/hamburgers.css" rel="stylesheet">
|
20
|
+
```
|
21
|
+
|
22
|
+
2. Add the base hamburger markup:
|
23
|
+
|
24
|
+
```html
|
25
|
+
<button class="hamburger" type="button">
|
26
|
+
<span class="hamburger-box">
|
27
|
+
<span class="hamburger-inner"></span>
|
28
|
+
</span>
|
29
|
+
</button>
|
30
|
+
```
|
31
|
+
|
32
|
+
You *can* use `<div>`s if you insist, but they’re not [accessible](#accessibility) as a menu button.
|
33
|
+
|
34
|
+
```html
|
35
|
+
<div class="hamburger">
|
36
|
+
<div class="hamburger-box">
|
37
|
+
<div class="hamburger-inner"></div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
```
|
41
|
+
|
42
|
+
3. Append the class name of the type of hamburger you’re craving:
|
43
|
+
|
44
|
+
```html
|
45
|
+
<button class="hamburger hamburger--collapse" type="button">
|
46
|
+
<span class="hamburger-box">
|
47
|
+
<span class="hamburger-inner"></span>
|
48
|
+
</span>
|
49
|
+
</button>
|
50
|
+
```
|
51
|
+
|
52
|
+
Here’s the list of hamburger-type classes you can choose from:
|
53
|
+
|
54
|
+
```
|
55
|
+
hamburger--3dx
|
56
|
+
hamburger--3dx-r
|
57
|
+
hamburger--3dy
|
58
|
+
hamburger--3dy-r
|
59
|
+
hamburger--arrow
|
60
|
+
hamburger--arrow-r
|
61
|
+
hamburger--arrowalt
|
62
|
+
hamburger--arrowalt-r
|
63
|
+
hamburger--boring
|
64
|
+
hamburger--collapse
|
65
|
+
hamburger--collapse-r
|
66
|
+
hamburger--elastic
|
67
|
+
hamburger--elastic-r
|
68
|
+
hamburger--emphatic
|
69
|
+
hamburger--emphatic-r
|
70
|
+
hamburger--slider
|
71
|
+
hamburger--slider-r
|
72
|
+
hamburger--spin
|
73
|
+
hamburger--spin-r
|
74
|
+
hamburger--spring
|
75
|
+
hamburger--spring-r
|
76
|
+
hamburger--stand
|
77
|
+
hamburger--stand-r
|
78
|
+
hamburger--squeeze
|
79
|
+
hamburger--vortex
|
80
|
+
hamburger--vortex-r
|
81
|
+
```
|
82
|
+
|
83
|
+
Note: `-r` classes are reverse variants (e.g. `hamburger--spin` spins clockwise whereas `hamburger--spin-r` spins counterclockwise.
|
84
|
+
|
85
|
+
4. Trigger the active state by appending class name `is-active`:
|
86
|
+
|
87
|
+
```html
|
88
|
+
<button class="hamburger hamburger--collapse is-active" type="button">
|
89
|
+
<span class="hamburger-box">
|
90
|
+
<span class="hamburger-inner"></span>
|
91
|
+
</span>
|
92
|
+
</button>
|
93
|
+
```
|
94
|
+
|
95
|
+
Since the class name would have to be toggled via JavaScript and implementation would differ based on the context of how you plan on using the hamburger, I’m going to leave the rest up to you.
|
96
|
+
|
97
|
+
## Sass
|
98
|
+
|
99
|
+
I’ve also included `.scss` source files if you use Sass as your CSS precompiler. It’s customizable and modular.
|
100
|
+
|
101
|
+
1. [Download](https://github.com/jonsuh/hamburgers/archive/master.zip) and unzip the source files.
|
102
|
+
2. Copy the files from the `_sass/hamburgers` directory into your project.
|
103
|
+
3. Import the `hamburgers.scss` file in your Sass manifest file:
|
104
|
+
|
105
|
+
```scss
|
106
|
+
@import "path/to/hamburgers";
|
107
|
+
```
|
108
|
+
|
109
|
+
4. Customize your hamburger and/or remove any types you don’t want in `hamburgers.scss`.
|
110
|
+
5. Compile your Sass*, and voila!
|
111
|
+
|
112
|
+
Hamburgers is also available on [npm](https://www.npmjs.com/package/hamburgers) and [Bower](http://bower.io/search/?q=css-hamburgers).
|
113
|
+
|
114
|
+
```
|
115
|
+
npm install hamburgers
|
116
|
+
bower install css-hamburgers
|
117
|
+
```
|
118
|
+
|
119
|
+
\* Be sure to run the CSS through [Autoprefixer](https://github.com/postcss/autoprefixer) since the Sass doesn’t account for vendor prefixes.
|
120
|
+
|
121
|
+
### Customization
|
122
|
+
|
123
|
+
Here is the full list of default settings (found in `_sass/hamburgers/hamburgers.scss`);
|
124
|
+
|
125
|
+
```scss
|
126
|
+
$hamburger-padding-x : 15px;
|
127
|
+
$hamburger-padding-y : 15px;
|
128
|
+
$hamburger-layer-width : 40px;
|
129
|
+
$hamburger-layer-height : 4px;
|
130
|
+
$hamburger-layer-spacing : 6px;
|
131
|
+
$hamburger-layer-color : #000;
|
132
|
+
$hamburger-layer-border-radius : 4px;
|
133
|
+
$hamburger-hover-opacity : 0.7;
|
134
|
+
$hamburger-hover-transition-duration : 0.15s;
|
135
|
+
$hamburger-hover-transition-timing-function: linear;
|
136
|
+
|
137
|
+
// To use CSS filters as the hover effect instead of opacity,
|
138
|
+
// set $hamburger-hover-use-filter as true and
|
139
|
+
// change the value of $hamburger-hover-filter accordingly.
|
140
|
+
$hamburger-hover-use-filter: false;
|
141
|
+
$hamburger-hover-filter : opacity(50%);
|
142
|
+
|
143
|
+
// Remove or comment out the hamburger types you don’t want
|
144
|
+
// or need, so they get excluded from the compiled CSS.
|
145
|
+
$hamburger-types: (
|
146
|
+
3dx,
|
147
|
+
3dx-r,
|
148
|
+
3dy,
|
149
|
+
3dy-r,
|
150
|
+
arrow,
|
151
|
+
arrow-r,
|
152
|
+
arrowalt,
|
153
|
+
arrowalt-r,
|
154
|
+
boring,
|
155
|
+
collapse,
|
156
|
+
collapse-r,
|
157
|
+
elastic,
|
158
|
+
elastic-r,
|
159
|
+
emphatic,
|
160
|
+
emphatic-r,
|
161
|
+
slider,
|
162
|
+
slider-r,
|
163
|
+
spring,
|
164
|
+
spring-r,
|
165
|
+
stand,
|
166
|
+
stand-r,
|
167
|
+
spin,
|
168
|
+
spin-r,
|
169
|
+
squeeze,
|
170
|
+
vortex,
|
171
|
+
vortex-r
|
172
|
+
);
|
173
|
+
```
|
174
|
+
|
175
|
+
To override any default settings, you can change the value(s) within `hamburgers.scss`, but I recommend you declare your new settings separately. Settings must come before `@import`:
|
176
|
+
|
177
|
+
```scss
|
178
|
+
$hamburgers-padding-x: 20px;
|
179
|
+
$hamburgers-padding-y: 15px;
|
180
|
+
|
181
|
+
@import "path/to/hamburgers";
|
182
|
+
```
|
183
|
+
|
184
|
+
You can also create a separate file (e.g. `hamburgers-settings.scss`) with those declarations, then import it along with Hamburgers:
|
185
|
+
|
186
|
+
```scss
|
187
|
+
@import "hamburgers-settings"
|
188
|
+
@import "path/to/hamburgers";
|
189
|
+
```
|
190
|
+
|
191
|
+
#### `ems` or `rems`
|
192
|
+
|
193
|
+
Wanna work with `ems` or `rems` instead of `px`? Just change all the `px` values to the unit of your choice. Note: Be consistent (all `px` or all `ems`), otherwise it may break—the math behind the customization will fail if it attempts to perform operations with values of different units.
|
194
|
+
|
195
|
+
### Not satisfied?
|
196
|
+
|
197
|
+
Dig into `_base.scss` or `types/` and customize to your heart’s content. Fair warning: It‘s pretty delicate and may break, especially if you tweak the animations themselves.
|
198
|
+
|
199
|
+
## Accessibility
|
200
|
+
|
201
|
+
Hamburger menu icons can be useful in the right context, but they’re not the most accessible.
|
202
|
+
|
203
|
+
ARIA will help make it accessible to people with disabilities.
|
204
|
+
|
205
|
+
```html
|
206
|
+
<button class="hamburger hamburger--elastic" type="button"
|
207
|
+
aria-label="Menu" aria-controls="navigation">
|
208
|
+
<span class="hamburger-box">
|
209
|
+
<span class="hamburger-inner"></span>
|
210
|
+
</span>
|
211
|
+
</button>
|
212
|
+
<nav id="navigation">
|
213
|
+
<!--navigation goes here-->
|
214
|
+
</nav>
|
215
|
+
```
|
216
|
+
|
217
|
+
If you insist on using `<div>`s, by default they’re not focusable (i.e. via keyboard or assistive technology). Add the `tabindex` attribute alongside ARIA.
|
218
|
+
|
219
|
+
```html
|
220
|
+
<div class="hamburger hamburger--elastic" tabindex="0"
|
221
|
+
aria-label="Menu" role="button" aria-controls="navigation">
|
222
|
+
<div class="hamburger-box">
|
223
|
+
<div class="hamburger-inner"></div>
|
224
|
+
</div>
|
225
|
+
</div>
|
226
|
+
<nav id="navigation">
|
227
|
+
<!--navigation goes here-->
|
228
|
+
</nav>
|
229
|
+
```
|
230
|
+
|
231
|
+
A label can help make it more obvious that it toggles a menu.
|
232
|
+
|
233
|
+
```html
|
234
|
+
<button class="hamburger hamburger--collapse" type="button">
|
235
|
+
<span class="hamburger-box">
|
236
|
+
<span class="hamburger-inner"></span>
|
237
|
+
</span>
|
238
|
+
<span class="hamburger-label">Menu</span>
|
239
|
+
</button>
|
240
|
+
```
|
241
|
+
|
242
|
+
Here are [some](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) [resources](https://webaccessibility.withgoogle.com/course) on [web](http://a11yproject.com/) [accessibility](http://www.html5accessibility.com/) and [ARIA](https://w3c.github.io/aria-in-html/).
|
243
|
+
|
244
|
+
## Browser Support
|
245
|
+
|
246
|
+
Animations use CSS3 3D transforms (`translate3d` whenever possible for GPU acceleration), which is supported by most browsers (not supported by IE9 and older and Opera Mini). For detailed browser support, check [caniuse.com](http://caniuse.com/#search=translate3d).
|