Repository: jonsuh/hamburgers
Branch: master
Commit: b26b25f8c70d
Files: 53
Total size: 94.8 KB
Directory structure:
gitextract_ghijoz3o/
├── .csscomb.dist.json
├── .editorconfig
├── .gitignore
├── .npmignore
├── CHANGELOG.md
├── Gemfile
├── LICENSE
├── README.md
├── _sass/
│ └── hamburgers/
│ ├── _base.scss
│ ├── hamburgers.scss
│ └── types/
│ ├── _3dx-r.scss
│ ├── _3dx.scss
│ ├── _3dxy-r.scss
│ ├── _3dxy.scss
│ ├── _3dy-r.scss
│ ├── _3dy.scss
│ ├── _arrow-r.scss
│ ├── _arrow.scss
│ ├── _arrowalt-r.scss
│ ├── _arrowalt.scss
│ ├── _arrowturn-r.scss
│ ├── _arrowturn.scss
│ ├── _boring.scss
│ ├── _collapse-r.scss
│ ├── _collapse.scss
│ ├── _elastic-r.scss
│ ├── _elastic.scss
│ ├── _emphatic-r.scss
│ ├── _emphatic.scss
│ ├── _minus.scss
│ ├── _slider-r.scss
│ ├── _slider.scss
│ ├── _spin-r.scss
│ ├── _spin.scss
│ ├── _spring-r.scss
│ ├── _spring.scss
│ ├── _squeeze.scss
│ ├── _stand-r.scss
│ ├── _stand.scss
│ ├── _vortex-r.scss
│ └── _vortex.scss
├── bower.json
├── bs-config.js
├── config.postcss.json
├── dist/
│ ├── example.html
│ └── hamburgers.css
├── eyeglass-exports.js
├── gulpfile.js
├── hamburgers.gemspec
├── index.js
├── lib/
│ ├── hamburgers/
│ │ └── version.rb
│ └── hamburgers.rb
└── package.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .csscomb.dist.json
================================================
{
"exclude": [
".git/**",
"node_modules/**",
"bower_components/**"
],
"always-semicolon": true,
"color-case": "lower",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": false,
"remove-empty-rulesets": true,
"unitless-zero": true,
"sort-order-fallback": "abc",
"sort-order": [
"font",
"font-family",
"font-size",
"font-weight",
"font-style",
"font-variant",
"font-size-adjust",
"font-stretch",
"font-effect",
"font-emphasize",
"font-emphasize-position",
"font-emphasize-style",
"font-smooth",
"line-height"
"position",
"z-index",
"top",
"right",
"bottom",
"left"
"display",
"visibility",
"float",
"clear",
"overflow",
"overflow-x",
"overflow-y",
"-ms-overflow-x",
"-ms-overflow-y",
"clip",
"zoom",
"flex-direction",
"flex-order",
"flex-pack",
"flex-align"
"-webkit-box-sizing",
"-moz-box-sizing",
"box-sizing",
"width",
"min-width",
"max-width",
"height",
"min-height",
"max-height",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left"
"table-layout",
"empty-cells",
"caption-side",
"border-spacing",
"border-collapse",
"list-style",
"list-style-position",
"list-style-type",
"list-style-image"
"content",
"quotes",
"counter-reset",
"counter-increment",
"resize",
"cursor",
"-webkit-user-select",
"-moz-user-select",
"-ms-user-select",
"user-select",
"nav-index",
"nav-up",
"nav-right",
"nav-down",
"nav-left",
"-webkit-transition",
"-moz-transition",
"-ms-transition",
"-o-transition",
"transition",
"-webkit-transition-delay",
"-moz-transition-delay",
"-ms-transition-delay",
"-o-transition-delay",
"transition-delay",
"-webkit-transition-timing-function",
"-moz-transition-timing-function",
"-ms-transition-timing-function",
"-o-transition-timing-function",
"transition-timing-function",
"-webkit-transition-duration",
"-moz-transition-duration",
"-ms-transition-duration",
"-o-transition-duration",
"transition-duration",
"-webkit-transition-property",
"-moz-transition-property",
"-ms-transition-property",
"-o-transition-property",
"transition-property",
"-webkit-transform",
"-moz-transform",
"-ms-transform",
"-o-transform",
"transform",
"-webkit-transform-origin",
"-moz-transform-origin",
"-ms-transform-origin",
"-o-transform-origin",
"transform-origin",
"-webkit-animation",
"-moz-animation",
"-ms-animation",
"-o-animation",
"animation",
"-webkit-animation-name",
"-moz-animation-name",
"-ms-animation-name",
"-o-animation-name",
"animation-name",
"-webkit-animation-duration",
"-moz-animation-duration",
"-ms-animation-duration",
"-o-animation-duration",
"animation-duration",
"-webkit-animation-play-state",
"-moz-animation-play-state",
"-ms-animation-play-state",
"-o-animation-play-state",
"animation-play-state",
"-webkit-animation-timing-function",
"-moz-animation-timing-function",
"-ms-animation-timing-function",
"-o-animation-timing-function",
"animation-timing-function",
"-webkit-animation-delay",
"-moz-animation-delay",
"-ms-animation-delay",
"-o-animation-delay",
"animation-delay",
"-webkit-animation-iteration-count",
"-moz-animation-iteration-count",
"-ms-animation-iteration-count",
"-o-animation-iteration-count",
"animation-iteration-count",
"-webkit-animation-direction",
"-moz-animation-direction",
"-ms-animation-direction",
"-o-animation-direction",
"animation-direction",
"text-align",
"-webkit-text-align-last",
"-moz-text-align-last",
"-ms-text-align-last",
"text-align-last",
"vertical-align",
"white-space",
"text-decoration",
"text-emphasis",
"text-emphasis-color",
"text-emphasis-style",
"text-emphasis-position",
"text-indent",
"-ms-text-justify",
"text-justify",
"letter-spacing",
"word-spacing",
"-ms-writing-mode",
"text-outline",
"text-transform",
"text-wrap",
"text-overflow",
"-ms-text-overflow",
"text-overflow-ellipsis",
"text-overflow-mode",
"-ms-word-wrap",
"word-wrap",
"word-break",
"-ms-word-break",
"-moz-tab-size",
"-o-tab-size",
"tab-size",
"-webkit-hyphens",
"-moz-hyphens",
"hyphens",
"pointer-events"
"opacity",
"filter:progid:DXImageTransform.Microsoft.Alpha(Opacity",
"-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha",
"-ms-interpolation-mode",
"color",
"border",
"border-width",
"border-style",
"border-color",
"border-top",
"border-top-width",
"border-top-style",
"border-top-color",
"border-right",
"border-right-width",
"border-right-style",
"border-right-color",
"border-bottom",
"border-bottom-width",
"border-bottom-style",
"border-bottom-color",
"border-left",
"border-left-width",
"border-left-style",
"border-left-color",
"-webkit-border-radius",
"-moz-border-radius",
"border-radius",
"-webkit-border-top-left-radius",
"-moz-border-radius-topleft",
"border-top-left-radius",
"-webkit-border-top-right-radius",
"-moz-border-radius-topright",
"border-top-right-radius",
"-webkit-border-bottom-right-radius",
"-moz-border-radius-bottomright",
"border-bottom-right-radius",
"-webkit-border-bottom-left-radius",
"-moz-border-radius-bottomleft",
"border-bottom-left-radius",
"-webkit-border-image",
"-moz-border-image",
"-o-border-image",
"border-image",
"-webkit-border-image-source",
"-moz-border-image-source",
"-o-border-image-source",
"border-image-source",
"-webkit-border-image-slice",
"-moz-border-image-slice",
"-o-border-image-slice",
"border-image-slice",
"-webkit-border-image-width",
"-moz-border-image-width",
"-o-border-image-width",
"border-image-width",
"-webkit-border-image-outset",
"-moz-border-image-outset",
"-o-border-image-outset",
"border-image-outset",
"-webkit-border-image-repeat",
"-moz-border-image-repeat",
"-o-border-image-repeat",
"border-image-repeat",
"outline",
"outline-width",
"outline-style",
"outline-color",
"outline-offset",
"background",
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader",
"background-color",
"background-image",
"background-repeat",
"background-attachment",
"background-position",
"background-position-x",
"-ms-background-position-x",
"background-position-y",
"-ms-background-position-y",
"-webkit-background-clip",
"-moz-background-clip",
"background-clip",
"background-origin",
"-webkit-background-size",
"-moz-background-size",
"-o-background-size",
"background-size",
"box-decoration-break",
"-webkit-box-shadow",
"-moz-box-shadow",
"box-shadow",
"filter:progid:DXImageTransform.Microsoft.gradient",
"-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient",
"text-shadow"
]
}
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
================================================
FILE: .gitignore
================================================
*gem
.DS_Store
bower_components
node_modules
js
css
yarn.lock
================================================
FILE: .npmignore
================================================
.DS_Store
node_modules
js
_js
css
*.mp4
*.ogv
*.webm
favicon.ico
hamburger.png
index.html
hamburgers.gemspec
Gemfile
lib/
================================================
FILE: CHANGELOG.md
================================================
# Changelog
Changelog for Hamburgers.
## [1.1.3] - 9/25/2018
### Fixed
- `!important` for types that rely on `background-color: transparent`.
## [1.1.2] - 9/25/2018
### Fixed
- Change default value of `$hamburger-active-hover-opacity` to `$hamburger-hover-opacity`.
- Change default value of `$hamburger-active-hover-filter` to `$hamburger-hover-filter`.
## [1.1.0] - 9/24/2018
### Added
- Changing color of the hamburger in the active state thanks to @andreamaiolo [#20](https://github.com/jonsuh/hamburgers/pull/20)
### Fixed
- Removed `$hamburger-hover-transition-duration` and `$hamburger-hover-transition-timing-function`—types rely on custom timing, which render these useless.
## [0.9.3] - 1/15/2018
### Fixed
- Missing `@if` statements in `arrowturn` and `arrowturn-r` variants [#51](https://github.com/jonsuh/hamburgers/pull/51).
- Update docs with correct `yarn` install command [#45](https://github.com/jonsuh/hamburgers/pull/45).
- Correct `eyeglass-module` tag in `package.json` [#48](https://github.com/jonsuh/hamburgers/pull/48).
## [0.9.1] - 7/6/2017
### Added
- Add new types: `3dxy`, `3dxy-r`, `arrowturn`, `arrowturn-r`, `minus`
### Updated
- Include missing and new types in `dist/example.html`.
- Update dependencies and include `package-lock.json`.
## [0.8.1] - 3/16/2017
### Updated
- Faster animations.
- Improved accessibility documentation thanks to @scottaohara [#baf5b5e](https://github.com/jonsuh/hamburgers/pull/34/commits/baf5b5ea3cf9bba155c8e74dc5b95e48e3384c4d).
## [0.7.0] - 11/29/2016
### Added
- [Eyeglass](http://eyeglass.rocks/) support.
## [0.6.0] - 11/22/2016
### Fixed
- Fix `spin-r`’s `.is-active::after` rotation. See https://github.com/jonsuh/hamburgers/issues/28.
## [0.5.0] - 04/04/2016
### Fixed
- `Error: Import directives may not be used within control directives or mixins.` in certain cases like when compiling with Ruby Sass.
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.:
```scss
@if index($hamburger-types, 3dx) {
.hamburger--3dx {
}
}
```
## [0.4.0] - 03/28/2016
### Improved
- 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`.)
## [0.3.0] - 03/07/2016
### Fixed
- Top positioning bug for Elastic and Slider ([#13fa295](https://github.com/jonsuh/hamburgers/commit/13fa2958ad18a2e48763824d3a68fd18b03ec274)).
### Added
- 4 hamburger types (with reverse variants)
```
hamburger--3dx
hamburger--3dx-r
hamburger--3dy
hamburger--3dy-r
hamburger--spring
hamburger--spring-r
hamburger--stand
hamburger--stand-r
```
## [0.2.0] - 03/04/2016
### Added
- Supports and favors more accessible and semantic markup:
```
```
## [0.1.6] - 03/02/2016
### Added
- [Bower](http://bower.io/) support.
## [0.1.5] - 03/02/2016
### Added
- Ability to customize `border-radius` of hamburger layers.
## [0.1.3] - 03/02/2016
- Public release.
================================================
FILE: Gemfile
================================================
source 'https://rubygems.org'
gemspec
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2016 Jonathan Suh (jonsuh.com)
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.
================================================
FILE: README.md
================================================
# Hamburgers
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.

### Table of Contents
- [Usage](#usage)
- [Sass](#sass)
- [Customization](#customization)
- [Accessibility](#accessibility)
- [Browser Support](#browser-support)
## Usage
1. [Download](https://github.com/jonsuh/hamburgers/blob/master/dist/hamburgers.css) and include the CSS in the `` of your site:
```html
```
2. Add the base hamburger markup:
```html
```
You *can* use `
`s if you insist, but they’re not [accessible](#accessibility) as a menu button.
```html
```
3. Append the class name of the type of hamburger you’re craving:
```html
```
Here’s the list of hamburger-type classes you can choose from:
```
hamburger--3dx
hamburger--3dx-r
hamburger--3dy
hamburger--3dy-r
hamburger--3dxy
hamburger--3dxy-r
hamburger--arrow
hamburger--arrow-r
hamburger--arrowalt
hamburger--arrowalt-r
hamburger--arrowturn
hamburger--arrowturn-r
hamburger--boring
hamburger--collapse
hamburger--collapse-r
hamburger--elastic
hamburger--elastic-r
hamburger--emphatic
hamburger--emphatic-r
hamburger--minus
hamburger--slider
hamburger--slider-r
hamburger--spin
hamburger--spin-r
hamburger--spring
hamburger--spring-r
hamburger--stand
hamburger--stand-r
hamburger--squeeze
hamburger--vortex
hamburger--vortex-r
```
Note: `-r` classes are reverse variants (e.g. `hamburger--spin` spins clockwise whereas `hamburger--spin-r` spins counterclockwise.
4. Trigger the active state by appending class name `is-active`:
```html
```
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.
## Sass
`.scss` source files are available if you use Sass as your CSS precompiler. It’s customizable and modular.
1. Hamburgers is available on [npm](https://www.npmjs.com/package/hamburgers), yarn and [Bower](http://bower.io/search/?q=css-hamburgers).
```
npm install hamburgers
yarn add hamburgers
bower install css-hamburgers
```
Also available as a [Ruby gem](https://rubygems.org/gems/hamburgers) to use within your Rails application—see [below](#install-for-ruby-on-rails) for more information.
Or to manually install it, [download](https://github.com/jonsuh/hamburgers/archive/master.zip) and unzip the source files, then copy the files from the `_sass/hamburgers` directory into your project.
2. Import the `hamburgers.scss` file in your Sass manifest file:
```scss
@import "path/to/hamburgers";
```
3. Customize your hamburger and/or remove any types you don’t want in `hamburgers.scss`.
4. Compile your Sass*, and voila!
\* Be sure to run the CSS through [Autoprefixer](https://github.com/postcss/autoprefixer) since the Sass doesn’t account for vendor prefixes.
### Install for Ruby on Rails
1. Add Hamburgers to your Gemfile.
```
gem 'hamburgers'
```
2. Run `bundle install`.
3. Include Hamburgers by using Sass’s native `@import`**:
```scss
// application.scss
@import "hamburgers";
```
\** [More information](https://blog.pivotal.io/pivotal-labs/labs/structure-your-sass-files-with-import) on why Sass’s native `@import` + why you should ditch Sprockets directives altogether.
## Customization
To override default settings, declare them before importing Hamburgers:
```scss
$hamburger-padding-x: 20px;
$hamburger-padding-y: 15px;
$hamburger-types : (collapse);
@import "hamburgers";
```
You can also create a separate file (e.g. `hamburgers-settings.scss`) with those declarations, then import it before Hamburgers:
```scss
@import "hamburgers-settings"
@import "hamburgers";
```
Here is the full list of default settings (found in `_sass/hamburgers/hamburgers.scss`);
```scss
$hamburger-padding-x : 15px;
$hamburger-padding-y : 15px;
$hamburger-layer-width : 40px;
$hamburger-layer-height : 4px;
$hamburger-layer-spacing : 6px;
$hamburger-layer-color : #000;
$hamburger-layer-border-radius : 4px;
$hamburger-hover-opacity : 0.7;
$hamburger-active-layer-color : $hamburger-layer-color;
$hamburger-active-hover-opacity: $hamburger-hover-opacity;
// To use CSS filters as the hover effect instead of opacity,
// set $hamburger-hover-use-filter as true and
// change the value of $hamburger-hover-filter accordingly.
$hamburger-hover-use-filter : false;
$hamburger-hover-filter : opacity(50%);
$hamburger-active-hover-filter: $hamburger-hover-filter;
// Remove or comment out the hamburger types you don’t want
// or need, so they get excluded from the compiled CSS.
$hamburger-types: (
3dx,
3dx-r,
3dy,
3dy-r,
3dxy,
3dxy-r,
arrow,
arrow-r,
arrowalt,
arrowalt-r,
arrowturn,
arrowturn-r,
boring,
collapse,
collapse-r,
elastic,
elastic-r,
emphatic,
emphatic-r,
minus,
slider,
slider-r,
spring,
spring-r,
stand,
stand-r,
spin,
spin-r,
squeeze,
vortex,
vortex-r
);
```
#### `ems` or `rems`
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.
### Not satisfied?
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.
## Accessibility
Hamburger menu icons can be useful in the right context, but they’re not the most accessible.
ARIA will help make it accessible to people with disabilities.
```html
```
You will need JavaScript to toggle between `aria-expanded` attribute being set to `true` and `false`, as this will indicate to visually impaired users whether the menu is opened or closed.
The hamburger button belongs __inside__ the `