From fee47f6414cc3ae9a88f3ee0ed20f1d6f2d9f556 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 14 Oct 2023 15:58:02 +0800 Subject: added plugin from postcss: postcss-fixes rucksack-css --- node_modules/rucksack-css/.eslintrc | 25 + node_modules/rucksack-css/.npmignore | 6 + node_modules/rucksack-css/.travis.yml | 5 + node_modules/rucksack-css/CHANGELOG.md | 203 +++ node_modules/rucksack-css/CONTRIBUTORS.md | 39 + node_modules/rucksack-css/LICENSE | 9 + node_modules/rucksack-css/README.md | 288 +++++ node_modules/rucksack-css/bin/cmd.js | 48 + node_modules/rucksack-css/bin/help.txt | 11 + node_modules/rucksack-css/index.js | 82 ++ .../node_modules/.bin/autoprefixer-info | 1 + .../rucksack-css/node_modules/.bin/browserslist | 1 + .../rucksack-css/node_modules/autoprefixer/AUTHORS | 147 +++ .../node_modules/autoprefixer/CHANGELOG.md | 760 ++++++++++++ .../rucksack-css/node_modules/autoprefixer/LICENSE | 20 + .../node_modules/autoprefixer/README.md | 628 ++++++++++ .../autoprefixer/bin/autoprefixer-info | 3 + .../node_modules/autoprefixer/data/prefixes.js | 705 +++++++++++ .../node_modules/autoprefixer/lib/at-rule.js | 70 ++ .../node_modules/autoprefixer/lib/autoprefixer.js | 126 ++ .../node_modules/autoprefixer/lib/brackets.js | 71 ++ .../node_modules/autoprefixer/lib/browsers.js | 99 ++ .../node_modules/autoprefixer/lib/declaration.js | 261 ++++ .../autoprefixer/lib/hacks/align-content.js | 86 ++ .../autoprefixer/lib/hacks/align-items.js | 83 ++ .../autoprefixer/lib/hacks/align-self.js | 84 ++ .../autoprefixer/lib/hacks/animation.js | 42 + .../autoprefixer/lib/hacks/appearance.js | 44 + .../autoprefixer/lib/hacks/background-size.js | 43 + .../autoprefixer/lib/hacks/block-logical.js | 52 + .../autoprefixer/lib/hacks/border-image.js | 40 + .../autoprefixer/lib/hacks/border-radius.js | 79 ++ .../autoprefixer/lib/hacks/break-props.js | 87 ++ .../autoprefixer/lib/hacks/cross-fade.js | 58 + .../autoprefixer/lib/hacks/display-flex.js | 102 ++ .../autoprefixer/lib/hacks/display-grid.js | 46 + .../autoprefixer/lib/hacks/filter-value.js | 37 + .../node_modules/autoprefixer/lib/hacks/filter.js | 40 + .../autoprefixer/lib/hacks/flex-basis.js | 79 ++ .../autoprefixer/lib/hacks/flex-direction.js | 112 ++ .../autoprefixer/lib/hacks/flex-flow.js | 83 ++ .../autoprefixer/lib/hacks/flex-grow.js | 62 + .../autoprefixer/lib/hacks/flex-shrink.js | 79 ++ .../autoprefixer/lib/hacks/flex-spec.js | 21 + .../autoprefixer/lib/hacks/flex-wrap.js | 44 + .../node_modules/autoprefixer/lib/hacks/flex.js | 91 ++ .../autoprefixer/lib/hacks/fullscreen.js | 45 + .../autoprefixer/lib/hacks/gradient.js | 525 ++++++++ .../autoprefixer/lib/hacks/grid-area.js | 86 ++ .../autoprefixer/lib/hacks/grid-column-align.js | 57 + .../autoprefixer/lib/hacks/grid-end.js | 73 ++ .../autoprefixer/lib/hacks/grid-row-align.js | 57 + .../autoprefixer/lib/hacks/grid-row-column.js | 62 + .../autoprefixer/lib/hacks/grid-rows-columns.js | 65 + .../autoprefixer/lib/hacks/grid-shorthand.js | 160 +++ .../autoprefixer/lib/hacks/grid-start.js | 62 + .../autoprefixer/lib/hacks/grid-template-areas.js | 137 +++ .../autoprefixer/lib/hacks/grid-template.js | 75 ++ .../autoprefixer/lib/hacks/image-rendering.js | 82 ++ .../autoprefixer/lib/hacks/image-set.js | 43 + .../autoprefixer/lib/hacks/inline-logical.js | 48 + .../autoprefixer/lib/hacks/intrinsic.js | 75 ++ .../autoprefixer/lib/hacks/justify-content.js | 91 ++ .../autoprefixer/lib/hacks/mask-border.js | 52 + .../node_modules/autoprefixer/lib/hacks/order.js | 77 ++ .../autoprefixer/lib/hacks/pixelated.js | 61 + .../autoprefixer/lib/hacks/placeholder.js | 58 + .../autoprefixer/lib/hacks/text-decoration.js | 43 + .../lib/hacks/text-emphasis-position.js | 39 + .../autoprefixer/lib/hacks/transform-decl.js | 118 ++ .../autoprefixer/lib/hacks/writing-mode.js | 50 + .../node_modules/autoprefixer/lib/info.js | 152 +++ .../node_modules/autoprefixer/lib/old-selector.js | 94 ++ .../node_modules/autoprefixer/lib/old-value.js | 32 + .../node_modules/autoprefixer/lib/prefixer.js | 188 +++ .../node_modules/autoprefixer/lib/prefixes.js | 510 ++++++++ .../node_modules/autoprefixer/lib/processor.js | 438 +++++++ .../node_modules/autoprefixer/lib/resolution.js | 154 +++ .../node_modules/autoprefixer/lib/selector.js | 180 +++ .../node_modules/autoprefixer/lib/supports.js | 380 ++++++ .../node_modules/autoprefixer/lib/transition.js | 446 +++++++ .../node_modules/autoprefixer/lib/utils.js | 93 ++ .../node_modules/autoprefixer/lib/value.js | 168 +++ .../node_modules/autoprefixer/package.json | 27 + .../node_modules/browserslist/CHANGELOG.md | 234 ++++ .../rucksack-css/node_modules/browserslist/LICENSE | 20 + .../node_modules/browserslist/README.md | 455 +++++++ .../node_modules/browserslist/browser.js | 29 + .../rucksack-css/node_modules/browserslist/cli.js | 103 ++ .../node_modules/browserslist/error.js | 12 + .../node_modules/browserslist/index.js | 671 ++++++++++ .../rucksack-css/node_modules/browserslist/node.js | 215 ++++ .../node_modules/browserslist/package.json | 86 ++ .../postcss-color-rgba-fallback/CHANGELOG.md | 45 + .../postcss-color-rgba-fallback/LICENSE | 20 + .../postcss-color-rgba-fallback/README.md | 104 ++ .../postcss-color-rgba-fallback/index.js | 141 +++ .../postcss-color-rgba-fallback/package.json | 38 + .../node_modules/postcss-reporter/CHANGELOG.md | 65 + .../node_modules/postcss-reporter/LICENSE | 22 + .../node_modules/postcss-reporter/README.md | 143 +++ .../node_modules/postcss-reporter/index.js | 4 + .../node_modules/postcss-reporter/lib/formatter.js | 80 ++ .../node_modules/postcss-reporter/lib/reporter.js | 81 ++ .../node_modules/postcss-reporter/lib/util.js | 20 + .../node_modules/postcss-reporter/package.json | 46 + .../node_modules/postcss-value-parser/LICENSE | 22 + .../node_modules/postcss-value-parser/README.md | 253 ++++ .../node_modules/postcss-value-parser/lib/index.js | 28 + .../node_modules/postcss-value-parser/lib/parse.js | 251 ++++ .../postcss-value-parser/lib/stringify.js | 48 + .../node_modules/postcss-value-parser/lib/unit.js | 49 + .../node_modules/postcss-value-parser/lib/walk.js | 22 + .../node_modules/postcss-value-parser/package.json | 58 + .../rucksack-css/node_modules/postcss/CHANGELOG.md | 552 +++++++++ .../node_modules/postcss/CONTRIBUTING.md | 78 ++ .../rucksack-css/node_modules/postcss/LICENSE | 20 + .../rucksack-css/node_modules/postcss/README-cn.md | 349 ++++++ .../rucksack-css/node_modules/postcss/README.md | 376 ++++++ .../node_modules/postcss/docs/architecture.md | 156 +++ .../node_modules/postcss/docs/guidelines/plugin.md | 195 +++ .../node_modules/postcss/docs/guidelines/runner.md | 143 +++ .../node_modules/postcss/docs/source-maps.md | 74 ++ .../node_modules/postcss/docs/syntax.md | 231 ++++ .../rucksack-css/node_modules/postcss/gulpfile.js | 97 ++ .../node_modules/postcss/lib/at-rule.js | 131 ++ .../node_modules/postcss/lib/comment.js | 61 + .../node_modules/postcss/lib/container.js | 907 ++++++++++++++ .../node_modules/postcss/lib/css-syntax-error.js | 256 ++++ .../node_modules/postcss/lib/declaration.js | 101 ++ .../rucksack-css/node_modules/postcss/lib/input.js | 204 +++ .../node_modules/postcss/lib/lazy-result.js | 435 +++++++ .../rucksack-css/node_modules/postcss/lib/list.js | 95 ++ .../node_modules/postcss/lib/map-generator.js | 323 +++++ .../rucksack-css/node_modules/postcss/lib/node.js | 625 ++++++++++ .../rucksack-css/node_modules/postcss/lib/parse.js | 41 + .../node_modules/postcss/lib/parser.js | 552 +++++++++ .../node_modules/postcss/lib/postcss.d.ts | 1301 ++++++++++++++++++++ .../node_modules/postcss/lib/postcss.js | 292 +++++ .../node_modules/postcss/lib/previous-map.js | 170 +++ .../node_modules/postcss/lib/processor.js | 240 ++++ .../node_modules/postcss/lib/result.js | 206 ++++ .../rucksack-css/node_modules/postcss/lib/root.js | 129 ++ .../rucksack-css/node_modules/postcss/lib/rule.js | 123 ++ .../node_modules/postcss/lib/stringifier.js | 344 ++++++ .../node_modules/postcss/lib/stringify.js | 17 + .../node_modules/postcss/lib/terminal-highlight.js | 83 ++ .../node_modules/postcss/lib/tokenize.js | 306 +++++ .../node_modules/postcss/lib/vendor.js | 52 + .../node_modules/postcss/lib/warn-once.js | 14 + .../node_modules/postcss/lib/warning.js | 122 ++ .../rucksack-css/node_modules/postcss/package.json | 25 + .../rucksack-css/node_modules/rgb-hex/index.js | 40 + .../rucksack-css/node_modules/rgb-hex/license | 21 + .../rucksack-css/node_modules/rgb-hex/package.json | 37 + .../rucksack-css/node_modules/rgb-hex/readme.md | 43 + node_modules/rucksack-css/package.json | 67 + node_modules/rucksack-css/test/fixtures/alias.css | 11 + .../rucksack-css/test/fixtures/alias.expected.css | 5 + .../rucksack-css/test/fixtures/autoprefixer.css | 3 + .../test/fixtures/autoprefixer.expected.css | 5 + .../rucksack-css/test/fixtures/clearfix.css | 3 + .../test/fixtures/clearfix.expected.css | 5 + .../rucksack-css/test/fixtures/easings.css | 11 + .../test/fixtures/easings.expected.css | 11 + .../rucksack-css/test/fixtures/fontpath.css | 6 + .../test/fixtures/fontpath.expected.css | 10 + .../rucksack-css/test/fixtures/hexrgba.css | 4 + .../test/fixtures/hexrgba.expected.css | 4 + node_modules/rucksack-css/test/fixtures/input.css | 6 + .../rucksack-css/test/fixtures/input.expected.css | 26 + .../rucksack-css/test/fixtures/laggard.css | 24 + .../test/fixtures/laggard.expected.css | 30 + .../rucksack-css/test/fixtures/position.css | 15 + .../test/fixtures/position.expected.css | 31 + .../rucksack-css/test/fixtures/quantity.css | 15 + .../test/fixtures/quantity.expected.css | 15 + .../rucksack-css/test/fixtures/responsive-type.css | 4 + .../test/fixtures/responsive-type.expected.css | 13 + node_modules/rucksack-css/test/test.js | 86 ++ node_modules/rucksack-css/yarn.lock | 1168 ++++++++++++++++++ 181 files changed, 24715 insertions(+) create mode 100644 node_modules/rucksack-css/.eslintrc create mode 100644 node_modules/rucksack-css/.npmignore create mode 100644 node_modules/rucksack-css/.travis.yml create mode 100644 node_modules/rucksack-css/CHANGELOG.md create mode 100644 node_modules/rucksack-css/CONTRIBUTORS.md create mode 100644 node_modules/rucksack-css/LICENSE create mode 100644 node_modules/rucksack-css/README.md create mode 100755 node_modules/rucksack-css/bin/cmd.js create mode 100644 node_modules/rucksack-css/bin/help.txt create mode 100644 node_modules/rucksack-css/index.js create mode 120000 node_modules/rucksack-css/node_modules/.bin/autoprefixer-info create mode 120000 node_modules/rucksack-css/node_modules/.bin/browserslist create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/AUTHORS create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/CHANGELOG.md create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/LICENSE create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/README.md create mode 100755 node_modules/rucksack-css/node_modules/autoprefixer/bin/autoprefixer-info create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/data/prefixes.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/at-rule.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/autoprefixer.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/brackets.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/browsers.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/declaration.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-content.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-items.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-self.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/animation.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/appearance.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/background-size.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/block-logical.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/border-image.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/border-radius.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/break-props.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/cross-fade.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/display-flex.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/display-grid.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/filter-value.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/filter.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-basis.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-direction.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-flow.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-grow.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-shrink.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-spec.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-wrap.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/fullscreen.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/gradient.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-area.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-column-align.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-end.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-row-align.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-row-column.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-shorthand.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-start.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-template-areas.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-template.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/image-rendering.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/image-set.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/inline-logical.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/intrinsic.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/justify-content.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/mask-border.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/order.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/pixelated.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/placeholder.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/text-decoration.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/transform-decl.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/writing-mode.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/info.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/old-selector.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/old-value.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/prefixer.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/prefixes.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/processor.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/resolution.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/selector.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/supports.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/transition.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/utils.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/lib/value.js create mode 100644 node_modules/rucksack-css/node_modules/autoprefixer/package.json create mode 100644 node_modules/rucksack-css/node_modules/browserslist/CHANGELOG.md create mode 100644 node_modules/rucksack-css/node_modules/browserslist/LICENSE create mode 100644 node_modules/rucksack-css/node_modules/browserslist/README.md create mode 100644 node_modules/rucksack-css/node_modules/browserslist/browser.js create mode 100755 node_modules/rucksack-css/node_modules/browserslist/cli.js create mode 100644 node_modules/rucksack-css/node_modules/browserslist/error.js create mode 100644 node_modules/rucksack-css/node_modules/browserslist/index.js create mode 100644 node_modules/rucksack-css/node_modules/browserslist/node.js create mode 100644 node_modules/rucksack-css/node_modules/browserslist/package.json create mode 100644 node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/CHANGELOG.md create mode 100755 node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/LICENSE create mode 100644 node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/README.md create mode 100644 node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/index.js create mode 100644 node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/package.json create mode 100644 node_modules/rucksack-css/node_modules/postcss-reporter/CHANGELOG.md create mode 100644 node_modules/rucksack-css/node_modules/postcss-reporter/LICENSE create mode 100644 node_modules/rucksack-css/node_modules/postcss-reporter/README.md create mode 100644 node_modules/rucksack-css/node_modules/postcss-reporter/index.js create mode 100644 node_modules/rucksack-css/node_modules/postcss-reporter/lib/formatter.js create mode 100644 node_modules/rucksack-css/node_modules/postcss-reporter/lib/reporter.js create mode 100644 node_modules/rucksack-css/node_modules/postcss-reporter/lib/util.js create mode 100644 node_modules/rucksack-css/node_modules/postcss-reporter/package.json create mode 100644 node_modules/rucksack-css/node_modules/postcss-value-parser/LICENSE create mode 100644 node_modules/rucksack-css/node_modules/postcss-value-parser/README.md create mode 100644 node_modules/rucksack-css/node_modules/postcss-value-parser/lib/index.js create mode 100644 node_modules/rucksack-css/node_modules/postcss-value-parser/lib/parse.js create mode 100644 node_modules/rucksack-css/node_modules/postcss-value-parser/lib/stringify.js create mode 100644 node_modules/rucksack-css/node_modules/postcss-value-parser/lib/unit.js create mode 100644 node_modules/rucksack-css/node_modules/postcss-value-parser/lib/walk.js create mode 100644 node_modules/rucksack-css/node_modules/postcss-value-parser/package.json create mode 100644 node_modules/rucksack-css/node_modules/postcss/CHANGELOG.md create mode 100644 node_modules/rucksack-css/node_modules/postcss/CONTRIBUTING.md create mode 100644 node_modules/rucksack-css/node_modules/postcss/LICENSE create mode 100644 node_modules/rucksack-css/node_modules/postcss/README-cn.md create mode 100644 node_modules/rucksack-css/node_modules/postcss/README.md create mode 100644 node_modules/rucksack-css/node_modules/postcss/docs/architecture.md create mode 100644 node_modules/rucksack-css/node_modules/postcss/docs/guidelines/plugin.md create mode 100644 node_modules/rucksack-css/node_modules/postcss/docs/guidelines/runner.md create mode 100644 node_modules/rucksack-css/node_modules/postcss/docs/source-maps.md create mode 100644 node_modules/rucksack-css/node_modules/postcss/docs/syntax.md create mode 100644 node_modules/rucksack-css/node_modules/postcss/gulpfile.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/at-rule.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/comment.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/container.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/css-syntax-error.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/declaration.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/input.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/lazy-result.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/list.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/map-generator.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/node.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/parse.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/parser.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/postcss.d.ts create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/postcss.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/previous-map.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/processor.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/result.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/root.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/rule.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/stringifier.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/stringify.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/terminal-highlight.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/tokenize.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/vendor.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/warn-once.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/lib/warning.js create mode 100644 node_modules/rucksack-css/node_modules/postcss/package.json create mode 100644 node_modules/rucksack-css/node_modules/rgb-hex/index.js create mode 100644 node_modules/rucksack-css/node_modules/rgb-hex/license create mode 100644 node_modules/rucksack-css/node_modules/rgb-hex/package.json create mode 100644 node_modules/rucksack-css/node_modules/rgb-hex/readme.md create mode 100644 node_modules/rucksack-css/package.json create mode 100644 node_modules/rucksack-css/test/fixtures/alias.css create mode 100644 node_modules/rucksack-css/test/fixtures/alias.expected.css create mode 100644 node_modules/rucksack-css/test/fixtures/autoprefixer.css create mode 100644 node_modules/rucksack-css/test/fixtures/autoprefixer.expected.css create mode 100644 node_modules/rucksack-css/test/fixtures/clearfix.css create mode 100644 node_modules/rucksack-css/test/fixtures/clearfix.expected.css create mode 100644 node_modules/rucksack-css/test/fixtures/easings.css create mode 100644 node_modules/rucksack-css/test/fixtures/easings.expected.css create mode 100644 node_modules/rucksack-css/test/fixtures/fontpath.css create mode 100644 node_modules/rucksack-css/test/fixtures/fontpath.expected.css create mode 100644 node_modules/rucksack-css/test/fixtures/hexrgba.css create mode 100644 node_modules/rucksack-css/test/fixtures/hexrgba.expected.css create mode 100644 node_modules/rucksack-css/test/fixtures/input.css create mode 100644 node_modules/rucksack-css/test/fixtures/input.expected.css create mode 100644 node_modules/rucksack-css/test/fixtures/laggard.css create mode 100644 node_modules/rucksack-css/test/fixtures/laggard.expected.css create mode 100644 node_modules/rucksack-css/test/fixtures/position.css create mode 100644 node_modules/rucksack-css/test/fixtures/position.expected.css create mode 100644 node_modules/rucksack-css/test/fixtures/quantity.css create mode 100644 node_modules/rucksack-css/test/fixtures/quantity.expected.css create mode 100644 node_modules/rucksack-css/test/fixtures/responsive-type.css create mode 100644 node_modules/rucksack-css/test/fixtures/responsive-type.expected.css create mode 100644 node_modules/rucksack-css/test/test.js create mode 100644 node_modules/rucksack-css/yarn.lock (limited to 'node_modules/rucksack-css') diff --git a/node_modules/rucksack-css/.eslintrc b/node_modules/rucksack-css/.eslintrc new file mode 100644 index 00000000..43ad337a --- /dev/null +++ b/node_modules/rucksack-css/.eslintrc @@ -0,0 +1,25 @@ +{ + "env": { + "node": true, + "es6": true + }, + "extends": "eslint:recommended", + "rules": { + "indent": [ + "error", + 2 + ], + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "single" + ], + "semi": [ + "error", + "always" + ] + } +} \ No newline at end of file diff --git a/node_modules/rucksack-css/.npmignore b/node_modules/rucksack-css/.npmignore new file mode 100644 index 00000000..51af743f --- /dev/null +++ b/node_modules/rucksack-css/.npmignore @@ -0,0 +1,6 @@ +# Deps +node_modules + +# Runtime +*.log +.DS_Store diff --git a/node_modules/rucksack-css/.travis.yml b/node_modules/rucksack-css/.travis.yml new file mode 100644 index 00000000..dd338dd6 --- /dev/null +++ b/node_modules/rucksack-css/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "4" + - "6" + - "8" diff --git a/node_modules/rucksack-css/CHANGELOG.md b/node_modules/rucksack-css/CHANGELOG.md new file mode 100644 index 00000000..a8df9c3c --- /dev/null +++ b/node_modules/rucksack-css/CHANGELOG.md @@ -0,0 +1,203 @@ +# Change Log + +## [v1.0.0](https://github.com/simplaio/rucksack/tree/v1.0.0) (2017-08-01) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.9.1...v1.0.0) + +**Closed issues:** + +- Impossible to use rems if set responsive on html? [\#53](https://github.com/simplaio/rucksack/issues/53) +- Position shorthand doesn't work more [\#48](https://github.com/simplaio/rucksack/issues/48) + +## [v0.9.1](https://github.com/simplaio/rucksack/tree/v0.9.1) (2016-11-25) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.9.0...v0.9.1) + +**Closed issues:** + +- Document reporter as addon in website [\#46](https://github.com/simplaio/rucksack/issues/46) + +## [v0.9.0](https://github.com/simplaio/rucksack/tree/v0.9.0) (2016-11-25) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.8.6...v0.9.0) + +**Fixed bugs:** + +- Problem when declaring text in content property if same as alias [\#41](https://github.com/simplaio/rucksack/issues/41) + +**Closed issues:** + +- I get undefined \[undefined\] - how I can debug it [\#44](https://github.com/simplaio/rucksack/issues/44) +- postcss-position-alt [\#43](https://github.com/simplaio/rucksack/issues/43) +- Autoprefixer options [\#40](https://github.com/simplaio/rucksack/issues/40) +- Responsive typography + line height? [\#31](https://github.com/simplaio/rucksack/issues/31) + +**Merged pull requests:** + +- Make reporter configurable, off by default [\#45](https://github.com/simplaio/rucksack/pull/45) ([jescalan](https://github.com/jescalan)) + +## [v0.8.6](https://github.com/simplaio/rucksack/tree/v0.8.6) (2016-04-17) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.8.5...v0.8.6) + +**Implemented enhancements:** + +- Show output code on home page [\#21](https://github.com/simplaio/rucksack/issues/21) + +**Fixed bugs:** + +- @font-face [\#26](https://github.com/simplaio/rucksack/issues/26) + +**Closed issues:** + +- Font shorthand property with calc\(\) statements don't work in Firefox [\#37](https://github.com/simplaio/rucksack/issues/37) +- Extension to quantity queries. Last 4 of 7 items. [\#35](https://github.com/simplaio/rucksack/issues/35) +- Invalid input file path error, when using Rucksack on Windows platform [\#33](https://github.com/simplaio/rucksack/issues/33) +- Autoprefixer with options? [\#29](https://github.com/simplaio/rucksack/issues/29) +- Font-size responsive no longer working as of ~Chrome 47.0.2526.73 [\#27](https://github.com/simplaio/rucksack/issues/27) +- Responsive font-size breaks in Chrome Canary [\#24](https://github.com/simplaio/rucksack/issues/24) + +**Merged pull requests:** + +- Fix psuedo -\> pseudo typo [\#34](https://github.com/simplaio/rucksack/pull/34) ([rmobis](https://github.com/rmobis)) +- Fix typo in input pseudo-elements title [\#32](https://github.com/simplaio/rucksack/pull/32) ([viki53](https://github.com/viki53)) + +## [v0.8.5](https://github.com/simplaio/rucksack/tree/v0.8.5) (2015-10-17) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.8.4...v0.8.5) + +**Implemented enhancements:** + +- Add node-pixrem to fallbacks [\#9](https://github.com/simplaio/rucksack/issues/9) + +## [v0.8.4](https://github.com/simplaio/rucksack/tree/v0.8.4) (2015-10-17) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.8.3...v0.8.4) + +## [v0.8.3](https://github.com/simplaio/rucksack/tree/v0.8.3) (2015-10-17) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.8.2...v0.8.3) + +**Closed issues:** + +- Alias and font responsive not working together [\#25](https://github.com/simplaio/rucksack/issues/25) + +## [v0.8.2](https://github.com/simplaio/rucksack/tree/v0.8.2) (2015-09-14) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.8.1...v0.8.2) + +## [v0.8.1](https://github.com/simplaio/rucksack/tree/v0.8.1) (2015-09-14) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.8.0...v0.8.1) + +## [v0.8.0](https://github.com/simplaio/rucksack/tree/v0.8.0) (2015-09-13) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.7.0...v0.8.0) + +**Implemented enhancements:** + +- Create transform scale\(\) -\> zoom fallback [\#17](https://github.com/simplaio/rucksack/issues/17) + +**Fixed bugs:** + +- Jumping issue in the documentation [\#23](https://github.com/simplaio/rucksack/issues/23) +- Move to PostCSS 5.0 [\#13](https://github.com/simplaio/rucksack/issues/13) + +**Merged pull requests:** + +- Add Node.js 4.0 stable to Travis config [\#22](https://github.com/simplaio/rucksack/pull/22) ([phillipalexander](https://github.com/phillipalexander)) + +## [v0.7.0](https://github.com/simplaio/rucksack/tree/v0.7.0) (2015-09-06) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.6.8...v0.7.0) + +## [v0.6.8](https://github.com/simplaio/rucksack/tree/v0.6.8) (2015-09-06) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.6.7...v0.6.8) + +**Implemented enhancements:** + +- Add toggle options to all features [\#19](https://github.com/simplaio/rucksack/issues/19) + +**Closed issues:** + +- Auto pesudo content fallback [\#18](https://github.com/simplaio/rucksack/issues/18) +- Responsive font issues in IE browser \(include edge\) [\#15](https://github.com/simplaio/rucksack/issues/15) + +## [v0.6.7](https://github.com/simplaio/rucksack/tree/v0.6.7) (2015-08-25) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.6.6...v0.6.7) + +## [v0.6.6](https://github.com/simplaio/rucksack/tree/v0.6.6) (2015-08-21) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.6.5...v0.6.6) + +## [v0.6.5](https://github.com/simplaio/rucksack/tree/v0.6.5) (2015-08-20) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.6.4...v0.6.5) + +**Closed issues:** + +- gh-pages site should not break with HTTPS [\#11](https://github.com/simplaio/rucksack/issues/11) +- Docs \(gh-pages\) [\#2](https://github.com/simplaio/rucksack/issues/2) + +**Merged pull requests:** + +- Fix spelling of Quantity [\#12](https://github.com/simplaio/rucksack/pull/12) ([davejamesmiller](https://github.com/davejamesmiller)) + +## [v0.6.4](https://github.com/simplaio/rucksack/tree/v0.6.4) (2015-08-18) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.6.3...v0.6.4) + +## [v0.6.3](https://github.com/simplaio/rucksack/tree/v0.6.3) (2015-08-15) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.6.2...v0.6.3) + +## [v0.6.2](https://github.com/simplaio/rucksack/tree/v0.6.2) (2015-08-15) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.6.1...v0.6.2) + +## [v0.6.1](https://github.com/simplaio/rucksack/tree/v0.6.1) (2015-08-15) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.6.0...v0.6.1) + +**Closed issues:** + +- Use postcss-reporter to output plugin warnings/errors [\#10](https://github.com/simplaio/rucksack/issues/10) + +## [v0.6.0](https://github.com/simplaio/rucksack/tree/v0.6.0) (2015-08-15) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.5.3...v0.6.0) + +## [v0.5.3](https://github.com/simplaio/rucksack/tree/v0.5.3) (2015-08-08) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.5.2...v0.5.3) + +## [v0.5.2](https://github.com/simplaio/rucksack/tree/v0.5.2) (2015-08-02) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.5.1...v0.5.2) + +## [v0.5.1](https://github.com/simplaio/rucksack/tree/v0.5.1) (2015-08-02) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.5.0...v0.5.1) + +## [v0.5.0](https://github.com/simplaio/rucksack/tree/v0.5.0) (2015-08-02) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.4.3...v0.5.0) + +**Closed issues:** + +- Gulp wrapper [\#5](https://github.com/simplaio/rucksack/issues/5) +- CLI tool [\#3](https://github.com/simplaio/rucksack/issues/3) + +## [v0.4.3](https://github.com/simplaio/rucksack/tree/v0.4.3) (2015-08-02) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.4.2...v0.4.3) + +**Closed issues:** + +- Grunt wrapper [\#4](https://github.com/simplaio/rucksack/issues/4) + +## [v0.4.2](https://github.com/simplaio/rucksack/tree/v0.4.2) (2015-08-02) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.4.1...v0.4.2) + +## [v0.4.1](https://github.com/simplaio/rucksack/tree/v0.4.1) (2015-08-02) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.4.0...v0.4.1) + +## [v0.4.0](https://github.com/simplaio/rucksack/tree/v0.4.0) (2015-07-26) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.3.1...v0.4.0) + +**Closed issues:** + +- Remove modular scale [\#8](https://github.com/simplaio/rucksack/issues/8) +- Add postcss-responsive-type [\#7](https://github.com/simplaio/rucksack/issues/7) + +## [v0.3.1](https://github.com/simplaio/rucksack/tree/v0.3.1) (2015-07-10) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.1.1...v0.3.1) + +## [v0.1.1](https://github.com/simplaio/rucksack/tree/v0.1.1) (2015-07-10) +[Full Changelog](https://github.com/simplaio/rucksack/compare/v0.3.0...v0.1.1) + +**Closed issues:** + +- Write README [\#1](https://github.com/simplaio/rucksack/issues/1) + +## [v0.3.0](https://github.com/simplaio/rucksack/tree/v0.3.0) (2015-07-08) + + +\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/node_modules/rucksack-css/CONTRIBUTORS.md b/node_modules/rucksack-css/CONTRIBUTORS.md new file mode 100644 index 00000000..44350401 --- /dev/null +++ b/node_modules/rucksack-css/CONTRIBUTORS.md @@ -0,0 +1,39 @@ +# CONTRIBUTORS +Rucksack is a collection of PostCSS plugins. Many were made specifically for Rucksack, some already existed in the PostCSS ecosystem and are bundled with the Rucksack framework, and some are included as optional add-ons. + +Rucksack MIT © 2017 [Sean King](https://twitter.com/seaneking) + +## Built for Rucksack + +- [postcss-responsive-type][postcss-responsive-type] (MIT © 2017 Sean King) +- [postcss-position][postcss-position] (MIT © 2017 Sean King) +- [postcss-clearfix][postcss-clearfix] (MIT © 2017 Sean King) +- [postcss-input-style][postcss-input-style] (MIT © 2017 Sean King) +- [postcss-fontpath][postcss-fontpath] (MIT © 2017 Sean King) +- [postcss-hexrgba][postcss-hexrgba] (MIT © 2017 Sean King) + +## Bundled with Rucksack + +- [postcss-quantity-queries][postcss-quantity-queries] (public domain) +- [postcss-easings][postcss-easings] (MIT © 2017 Andrey Sitnik) + +## Optional Addons + +- [autoprefixer][autoprefixer] (MIT © 2017 Andrey Sitnik) +- [laggard][laggard] (MIT © 2017 Sean King)1 + +_[1] Laggard includes other 3rd party plugins, see it's CONTRIBUTORS file for more information_ + +[postcss-responsive-type]: https://github.com/seaneking/postcss-responsive-type +[postcss-position]: https://github.com/seaneking/postcss-position +[postcss-alias]: https://github.com/seaneking/postcss-alias +[postcss-clearfix]: https://github.com/seaneking/postcss-clearfix +[postcss-input-style]: https://github.com/seaneking/postcss-input-style +[postcss-fontpath]: https://github.com/seaneking/postcss-fontpath +[postcss-hexrgba]: https://github.com/seaneking/postcss-hexrgba + +[postcss-quantity-queries]: https://github.com/pascalduez/postcss-quantity-queries +[postcss-easings]: https://github.com/postcss/postcss-easings + +[autoprefixer]: https://github.com/postcss/autoprefixer +[laggard]: https://github.com/seaneking/laggard diff --git a/node_modules/rucksack-css/LICENSE b/node_modules/rucksack-css/LICENSE new file mode 100644 index 00000000..0a4785f8 --- /dev/null +++ b/node_modules/rucksack-css/LICENSE @@ -0,0 +1,9 @@ +# License + +Copyright 2017 Sean King + +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. diff --git a/node_modules/rucksack-css/README.md b/node_modules/rucksack-css/README.md new file mode 100644 index 00000000..00a3ee8c --- /dev/null +++ b/node_modules/rucksack-css/README.md @@ -0,0 +1,288 @@ +

+ rucksack logo +

+ +

+ NPM version + Downloads + Build satus +

+ +A little bag of CSS superpowers, built on [PostCSS][postcss]. + +Rucksack makes CSS development less painful, with the features and shortcuts it should have come with out of the box. + +**Read the full docs at [simplaio.github.io](https://simplaio.github.io/rucksack)** + +### Contents + +- [Install](#install) +- [Usage](#usage) + - [Gulp](#gulp) + - [Grunt](#grunt) + - [Broccoli](#broccoli) + - [CLI](#cli) + - [PostCSS](#postcss) + - [Stylus](#stylus) +- [Features](#features) + - [Responsive typography](#responsive-typography) + - [Shorthand positioning syntax](#shorthand-positioning-syntax) + - [Native clearfix](#native-clearfix) + - [Automatic font src generation](#automatic-font-src-generation) + - [Extra input pseudo-elements](#extra-input-pseudo-elements) + - [Hex shortcuts for RGBA](#hex-shortcuts-for-rgba) + - [More easing functions](#more-easing-functions) + - [Quantity pseudo-selectors](#quantity-pseudo-selectors) + - [CSS property aliases](#css-property-aliases) +- [Addons](#addons) + - [Autoprefixer](#autoprefixer) + - [Legacy Fallbacks](#legacy-fallbacks) +- [Options](#options) + + +## Install + +Rucksack is available on NPM under `rucksack-css`, install it with Yarn or NPM + +```sh +$ yarn add rucksack-css --dev +``` + + +```sh +$ npm i rucksack-css --save-dev +``` + +## Usage + +Rucksack can be used as a PostCSS plugin, direclty on the command line, and has helpers available for most build tools. + +#### Gulp + +Use [gulp-rucksack][gulp-rucksack] + +```js +const gulp = require('gulp'); +const rucksack = require('gulp-rucksack'); + +gulp.task('rucksack', () => { + return gulp.src('src/style.css') + .pipe(rucksack()) + .pipe(gulp.dest('style.css')); +}); +``` + +#### Grunt + +Use [grunt-rucksack][grunt-rucksack] + +```js +require('load-grunt-tasks')(grunt); + +grunt.initConfig({ + rucksack: { + compile: { + files: { + 'style.css': 'src/style.css' + } + } + } +}); + +grunt.registerTask('default', ['rucksack']); +``` + +#### Broccoli + +Use [broccoli-rucksack][broccoli-rucksack] + +```js +const rucksack = require('broccoli-rucksack'); + +tree = rucksack(tree, [options]); +``` + +#### CLI + +Process CSS directly on the command line + +```sh +$ rucksack src/style.css style.css [options] +``` + +#### PostCSS + +Rucksack is built on PostCSS, and can be used as a PostCSS plugin + +```js +const postcss = require('postcss'); +const rucksack = require('rucksack-css'); + +postcss([ rucksack() ]) + .process(css, { from: 'src/style.css', to: 'style.css' }) + .then(result => { + fs.writeFileSync('style.css', result.css); + if ( result.map ) fs.writeFileSync('style.css.map', result.map); + }); +``` + +See the [PostCSS Docs][postcss] for examples for your environment. + +#### Stylus + +Rucksack can be used as a Stylus plugin with [PostStylus][poststylus] + +```js +stylus(css).use(poststylus('rucksack-css')) +``` + +See the [PostStylus Docs][poststylus] for more examples for your environment. + +## Features + +#### Responsive typography + +Automagical fluid typography with new `responsive` arguments to `font-size`, `line-height`, and `letter-spacing` properties + +```css +.foo { + font-size: responsive; +} +``` + +![Responsive Type Demo][type-demo] + +#### Shorthand positioning syntax + +Use the shorthand syntax from `margin` and `padding` on `position` properties + +```css +.foo { + position: absolute 0 20px; +} +``` + +#### Native clearfix + +Generate bulletproof clearfixes with a new argument on the `clear` property + +```css +.foo { + clear: fix; +} +``` + +#### Automatic font src generation + +Automatically generate `src` sets for `@font-face` based on the path to your font files + +```css +@font-face { + font-family: 'My Font'; + font-path: '/path/to/font/file'; +} +``` + +#### Extra input pseudo-elements + +Standardize the unweidly `` element across browsers with new `::track` and `::thumb` pseudo elements + +```css +input[type="range"]::track { + height: 2px; +} +``` + +#### Hex shortcuts for RGBA + +Generate RGBA colors from a hex color + alpha value + +```css +.foo { + color: rgba(#fff, 0.8); +} +``` + +#### More easing functions + +Use a whole library of modern easing functions in transitions and animations + +```css +.foo { + transition: all 250ms ease-out-cubic; +} +``` + +#### Quantity pseudo-selectors + +Create truly responsive designs with powerful content quantity selectors + +```css +li:at-least(4) { + color: blue; +} + +li:between(4,6) { + color: red; +} +``` + +#### CSS property aliases + +```css +@alias { + fs: font-size; + bg: background; +} + +.foo { + fs: 16px; + bg: #fff; +} +``` + +## Addons + +#### Autoprefixer + +Automatically apply vendor prefixes to relevant properties based on data from [CanIUse][caniuse], via [autoprefixer][autoprefixer]. + +#### Legacy Fallbacks + +Automatically generate CSS fallbacks for legacy browsers, via [laggard][laggard]. + +## Options + +All features in Rucksack can be toggled by passing options on initialization. By default core features are set to `true`, and optional +addons are set to `false` + +Option | Type | Default | Description +------------------- | ------- | ------- | ----------- +`responsiveType` | Boolean | `true` | Whether to enable responsive typography +`shorthandPosition` | Boolean | `true` | Whether to enable shorthand position properties +`quantityQueries` | Boolean | `true` | Whether to enable quantity query psuedo selectors +`alias` | Boolean | `true` | Whether to enable to enable property aliases +`inputPseudo` | Boolean | `true` | Whether to enable whether to enable extra input pseudo elements +`clearFix` | Boolean | `true` | Whether to enable native clear fix +`fontPath` | Boolean | `true` | Whether to enable font `src` set generation +`hexRGBA` | Boolean | `true` | Whether to enable hex RGBA shortcuts +`easings` | Boolean | `true` | Whether to enable extra easing functions +`fallbacks` | Boolean | `false` | Whether to enable CSS fallbacks addon +`autoprefixer` | Boolean | `false` | Whether to enable autoprefixer addon +`reporter` | Boolean | `false` | Whether to enable error reporting from plugins used inside Rucksack + + +*** + +MIT © [Sean King][sean] + +[postcss]: https://github.com/postcss/postcss +[gulp-rucksack]: https://github.com/simplaio/gulp-rucksack +[grunt-rucksack]: https://github.com/simplaio/grunt-rucksack +[broccoli-rucksack]: https://github.com/simplaio/broccoli-rucksack +[poststylus]: https://github.com/seaneking/poststylus +[type-demo]: http://simplaio.github.io/rucksack/img/type-demo.gif +[caniuse]: http://caniuse.com +[autoprefixer]: https://github.com/postcss/autoprefixer +[laggard]: https://github.com/seaneking/laggard +[sean]: https://twitter.com/seaneking diff --git a/node_modules/rucksack-css/bin/cmd.js b/node_modules/rucksack-css/bin/cmd.js new file mode 100755 index 00000000..e8ac0192 --- /dev/null +++ b/node_modules/rucksack-css/bin/cmd.js @@ -0,0 +1,48 @@ +#!/usr/bin/env node +/*eslint no-console: 0, no-undef: 0*/ + +'use strict'; + +const fs = require('fs'); +const read = require('read-file-stdin'); +const write = require('write-file-stdout'); +const minimist = require('minimist'); +const rucksack = require('../'); + +const OPTS = minimist(process.argv.slice(2), { + boolean: [ 's', 'autoprefixer', 'fallbacks' ], + alias: { + h: 'help', + s: 'sourcemap', + v: 'version' + } + }), + FILE = OPTS._[0], + OUT = OPTS._[1]; + +// Fetch verion from package.json +if (OPTS.version) { + return console.log(require('../package.json').version); +} + +// Pipe out help doc from help.txt +if (FILE === 'help' || OPTS.help) { + return fs.createReadStream(path.join(__dirname, '/help.txt')) + .pipe(process.stdout) + .on('close', () => process.exit(1)); +} + +read(FILE, function (err, buf) { + if (err) { + throw err; + } + rucksack.process(String(buf), { from: FILE, to: OUT }).then(function (result) { + write(OUT, result.css); + if (OPTS.map && OPTS.to) { + fs.writeFile(OPTS.to + '.map', result.map.toString()); + } + }).catch((err) => { + console.error(err); + process.exit(1); + }); +}); \ No newline at end of file diff --git a/node_modules/rucksack-css/bin/help.txt b/node_modules/rucksack-css/bin/help.txt new file mode 100644 index 00000000..567865ff --- /dev/null +++ b/node_modules/rucksack-css/bin/help.txt @@ -0,0 +1,11 @@ +Usage: rucksack [input] [output] {OPTIONS} + +Options: + + --autoprefixer Enable automatic vendor prefixing. + + --fallbacks Enable legacy fallbacks. + + --version, -v Show the version number. + + --help, -h Show this help screen. diff --git a/node_modules/rucksack-css/index.js b/node_modules/rucksack-css/index.js new file mode 100644 index 00000000..3368cc40 --- /dev/null +++ b/node_modules/rucksack-css/index.js @@ -0,0 +1,82 @@ +'use strict'; + +const postcss = require('postcss'); + +const PLUGINS = [ + { + option: 'alias', + module: require('postcss-alias') + }, + { + option: 'responsiveType', + module: require('postcss-responsive-type') + }, + { + option: 'shorthandPosition', + module: require('postcss-position') + }, + { + option: 'quantityQueries', + module: require('postcss-quantity-queries') + }, + { + option: 'inputPseudo', + module: require('postcss-input-style') + }, + { + option: 'clearFix', + module: require('postcss-clearfix') + }, + { + option: 'fontPath', + module: require('postcss-fontpath') + }, + { + option: 'hexRGBA', + module: require('postcss-hexrgba') + }, + { + option: 'easings', + module: require('postcss-easings') + }, + { + option: 'fallbacks', + module: require('laggard') + }, + { + option: 'autoprefixer', + module: require('autoprefixer') + }, + { + option: 'reporter', + module: require('postcss-reporter') + } + ], + DEFAULTS = { + alias: true, + responsiveType: true, + shorthandPosition: true, + quantityQueries: true, + inputPseudo: true, + clearFix: true, + fontPath: true, + hexRGBA: true, + easings: true, + autoprefixer: false, + fallbacks: false, + reporter: false + }; + +// Export plugin bundle +module.exports = postcss.plugin('rucksack', opts => { + opts = opts || {}; + + let config = Object.assign({}, DEFAULTS, opts), + bundle = postcss(); + + PLUGINS.forEach(plugin => { + config[plugin.option] && bundle.use(plugin.module); + }); + + return bundle; +}); \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/.bin/autoprefixer-info b/node_modules/rucksack-css/node_modules/.bin/autoprefixer-info new file mode 120000 index 00000000..e2d51b41 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/.bin/autoprefixer-info @@ -0,0 +1 @@ +../autoprefixer/bin/autoprefixer-info \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/.bin/browserslist b/node_modules/rucksack-css/node_modules/.bin/browserslist new file mode 120000 index 00000000..3cd991b2 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/.bin/browserslist @@ -0,0 +1 @@ +../browserslist/cli.js \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/AUTHORS b/node_modules/rucksack-css/node_modules/autoprefixer/AUTHORS new file mode 100644 index 00000000..39bbd462 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/AUTHORS @@ -0,0 +1,147 @@ +# This is the official list of Autoprefixer authors for copyright purposes. +# +# This does not necessarily list everyone who has contributed code, since in +# some cases, their employer may be the copyright holder. To see the full list +# of contributors, see the revision history in source control or +# https://github.com/postcss/autoprefixer/graphs/contributors +# +# Authors who wish to be recognized in this file should add themselves (or +# their employer, as appropriate). + +Aaron +Adam Lynch +Adonis K +Adriaan +Aleksei Androsov +Aleksey Shvayka +Aleks Hudochenkov +Alexey Komarov +Alexey Plutalov +Anders Olsen Sandvik +Andreas Haller +Andreas Lind +Andrew Rhoads +Andrey Sitnik +Andrey Taritsyn +Andy Trevorah +Anton Khlynovskiy +Artem Yavorsky +aruseni +Ben Briggs +bernig +Bogdan Chadkin +brainopia +Brandon Mathis +Chad von Nau +Chi Vinh Le +Cory House +Cory Simmons +Craig Martin +Damon +Daniel Garcia-Carrillo +Daniel Tschinder +Danny Pule +Darius +David Narbutovich +David Pike +Denis Sokolov +Dominik Porada +Dominik Schilling +dotch +Dmitry Semigradsky +Efremov Alexey +eitanr +Erik Sundahl +Eugene Datsky +Evgeny Petukhov +Evilebot Tnawi +Fangzhou Li +Forrest York +Google Inc. +Gregory Eremin +GU Yiling +Hallvord R. M. Steen +heady +Iain Beeston +Igor Adamenko +Jack Moore +Jason Kuhrt +Jeff Escalante +Joan León +Johannes J. Schmidt +John Kreitlow +Jonathan Ong +Josh Gillies +Junliang Huang +jvdanilo +Kevin Pfefferle +Kieran +Kir Shatrov +Kiwi +kizu +Leonya Khachaturov +Lovchikov Anton +L.T +Lucas Caton +Luciano Battagliero +Luke Page +martco +Matt Smith +Maxime Thirouin +Max Mechanic +Michael Beil +Michael Scott Hertzberg +Michał Gołębiowski-Owczarek +Mikael Jorhult +Morton Fox +mvasilkov +Nick Howes +Nick Marchenko +Nick Schonning +nickspielgist +Niels Dequeker +Nikolay Burlov +Oleksandr Sergiienko +Pavel Pustovalov +Paul Statezny +Peter van Westen +Peter Zotov +Phil Dokas +Rafael Silva +Ray Lehnhoff +ReadmeCritic +Reinaldo Schiehll +René Stalder +Richard Wang +Rob Howell +Roland Warmerdam +Roman Dvornov +Ryan Zimmerman +Sami Suo-Heikki +Sasha Koss +Sean Anderson +Sergey Belov +Sergey Leschina +sethjgore +Šime Vidas +Simon Lydell +Sindre Sorhus +Stephen Edgar +Steve Mao +Stig Otnes Kolstad +Subash Pathak +sunhao +tomdavenport +Tony Ganch +Vegard Andreas Larsen +Vera Surkova +Vincent De Oliveira +Vishnu Ravi +Vladimir Pouzanov +vladkens +Yet Another Minion +Даниил Пронин +一丝 +刘祺 +忆初 diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/CHANGELOG.md b/node_modules/rucksack-css/node_modules/autoprefixer/CHANGELOG.md new file mode 100644 index 00000000..ebad6546 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/CHANGELOG.md @@ -0,0 +1,760 @@ +# Change Log +This project adheres to [Semantic Versioning](http://semver.org/). + +## 7.2.6 +* Fix `-ms-` prefix for grid cells with same `grid-area` (by Evgeny Petukhov). + +## 7.2.5 +* Fix multiple prefixes in declaration value. + +## 7.2.4 +* Fix IE 10 support. + +## 7.2.3 +* Fix `grid-template-areas` in `@media` (by Evgeny Petukhov). + +## 7.2.2 +* Fix `_autoprefixerDisabled is undefined` issue. + +## 7.2.1 +* Fix IE and other old JS runtimes support. + +## 7.2 “Ordem e Progresso” +* Add `grid-template-areas` support (by Evgeny Petukhov). +* Add `grid-template` support (by Evgeny Petukhov). +* Add `grid-area` support (by Alexey Komarov). +* Add `autoprefixer-info` CLI tool. +* Add wrong `radial-gradient` properties warning. +* Use current working dir on missed `from` in `info()` (by Phil Dokas). +* Fix `grid-row` and `grid-column` support (by Alexey Komarov). +* Do not prefix `reverse` animation direction. +* Improve test coverage (by Dmitry Semigradsky). + +## 7.1.6 +* Add warning for using `browserslist` option instead of `browsers`. +* Add warning for multiple control comments in the same scope. +* Fix `Invalid array length` error during indent changes. + +## 7.1.5 +* Fix `::placeholder` prefix for Edge. +* Fix `inherit`/`initial`/`unset` values for `flex-direction`. +* Fix RegExp usage in gradients (by Yet Another Minion). + +## 7.1.4 +* Fix `radial-gradient` direction conversion. +* Fix `image-set` in `cursor`. + +## 7.1.3 +* Add warning for old `radial-gradient` direction syntax. + +## 7.1.2 +* Fix `text-decoration` shortcut support. + +## 7.1.1 +* Remove non-`-webkit-` intrinsic prefixes in Grid Layout (by 一丝). + +## 7.1 “Universitas litterarum” +* Add `unicode-bidi` support. +* Add `-webkit-appearance` support for Edge. +* Add `from` option to `info()`. +* Fix intrinsic widths prefixes in Grid Layout. + +## 7.0.1 +* Fix Autoprefixer for old JS runtimes. + +## 7.0 “Coelestem adspicit lucem” +* Remove node.js 0.12 support. +* Use PostCSS 6.0. +* Use Browserslist 2. +* Use `caniuse-lite` instead of `caniuse-db` (by Ben Briggs). +* Use `^` for Browserslist dependencies, instead of `~`. +* Rewrite project from CoffeeScript to Babel (by Dmitry Semigradsky). +* Disable Grid Layout prefixes for IE by default. +* Fix `-ms-grid-column-align`. +* Move tests to Jest. + +## 6.7.7 +* Fix `order` for non-digit values. + +## 6.7.6 +* Fix `font-kerning` (by Chi Vinh Le). + +## 6.7.5 +* Fix `text-decoration-skip` in iOS (by Chi Vinh Le). +* Fix `clip-path` (by Chi Vinh Le). + +## 6.7.4 +* Improve `browsers` option perfomance. +* Update CoffeeScript compiler. + +## 6.7.3 +* Fix compatibility with “Intrinsic & Extrinsic Sizing” spec update. + +## 6.7.2 +* Do not prefix grid/flexbox in `@supports` on `grid: false`/`flexbox: false`. + +## 6.7.1 +* Update Browserslist with `last n version` fix. + +## 6.7 “Krungthep doot thep saang” +* Add Electron support in browsers list (by Kilian Valkhof). +* Add `flex-flow` partial support for Flexbox 2009 specification. +* Fix browsers `0` version issue in some Can I Use data. + +## 6.6.1 +* Add metadata to use Autoprefixer in JSS tests (by Chi Vinh Le). + +## 6.6 “Kaiyuan” +* Add `browserslist` key in `package.json` support. +* Add support for separated environments in browserslist config. +* Add `browserslist-stats.json` file support to load custom usage statistics. + +## 6.5.4 +* Fix unitless 0 basis in IE10/IE11 shorthand flex (by Google). + +## 6.5.3 +* Add error for popular mistake with `browser` option instead of `browsers`. + +## 6.5.2 +* Clean prefixes data (by Reinaldo Schiehll). + +## 6.5.1 +* Fix selectors with `:--` prefix support. + +## 6.5 “Einigkeit und Recht und Freiheit” +* Add `defaults` keyword to browsers requirements. +* Fix CSS Grid Layout support. +* Fix `align-self` cleaning. + +## 6.4.1 +* Fix node cloning after some PostCSS plugins. + +## 6.4 “Hic et ubique terrarum” +* Add `:any-link` selector support. +* Add `text-decoration-skip` support. +* Add `transition: duration property` support. +* Fix `-webkit-` prefix for `backface-visibility`. +* Fix `rad` unit support in gradients (by 刘祺). +* Fix `transition` support in Opera 12. +* Removed Safari TP Grid prefixes support. + +## 6.3.7 +* Fix rare `Cannot read property 'constructor' of null` issue. + +## 6.3.6 +* Add Safari TP prefix support for Grid Layout. + +## 6.3.5 +* Fix duplicate prefixes for `-ms-interpolation-mode`. + +## 6.3.4 +* Show users coverage for selected browsers in `info()`. + +## 6.3.3 +* Fix transition warning. + +## 6.3.2 +* Fix jspm support (by Sean Anderson). + +## 6.3.1 +* Fix compatibility with Flexibility polyfill. + +## 6.3 “Pro rege et lege” +* Add Grid Layout support. +* Add `text-spacing` support. +* Add `> 10% in my stats` browsers query with custom usage statistics. +* Add options to disable `@supports`, Flexbox or Grid support. +* Fix compatibility with other PostCSS plugins. + +## 6.2.3 +* Fix error on broken transition with double comma. + +## 6.2.2 +* Fix issues in broken transitions. + +## 6.2.1 +* Fix AST error in transition warning (by @jvdanilo). + +## 6.2 “Fluctuat nec mergitur” +* Use `fill` instead of `fill-available` according spec changes (by 一丝). +* Add `fill` support for logical dimension properties (by 一丝). +* Add `text-emphasis` support (by 一丝). +* Add prefixes to `@supports` only for compatible browsers. +* Add `rad`, `grad` and `turn` units support to linear gradients. +* Add some `deg` directions support for old WebKit linear gradients. +* Fix `@supports` parenthesis (by @heady). +* Add warning when prefixes could not be generated + for complicated `transition-property` values. +* Add warning for outdated `fill-available` value. +* Add warning for wrong `text-emphasis-position` value. +* Add “time capsule” warning for prefix-less future. +* Normalizes all warning messages. + +## 6.1.2 +* Fix gradient hack on some parameters (by Alexey Efremov). + +## 6.1.1 +* Fix `cursor: grab` and `cursor: grabbing` support. + +## 6.1 “Bil-shaʿb wa lil-shaʿb” +* Change `transition` support to output more robust CSS. +* Add `:read-only` support. +* Add support for `appearance` with any values. +* Add CSS-in-JS support via `postcss-js`. +* Add loud `/*! autoprefixer: off */` control comments support. +* Convert `rotateZ` to `rotate` for `-ms-transform`. +* Use `postcss-value-parser` to carefully work with gradients. +* Remove `-ms-transform-style` and `-o-transform-style` that never existed. + +## 6.0.3 +* Fix old gradient direction warning. + +## 6.0.2 +* Remove unnecessary `-khtml-` prefix too. + +## 6.0.1 +* Fix `cross-fade()` support (by 一丝). + +## 6.0 “Eureka” +* CLI was removed from `autoprefixer` package to `autoprefixer-cli`. +* `autoprefixer-core` and `autoprefixer` packages was merged back. +* Remove `autoprefixer(opt).process(css)`, use `autoprefixer.process(css, opt)`. +* Remove `safe` option. Use separated Safe parser from PostCSS. +* Remove Opera 12.1 from default query. +* Use PostCSS 5.0 API. +* Add custom syntaxes support. +* Add `image-set` support (by 一丝). +* Add `mask-border` support (by 一丝). +* Add `filter()` function support (by Vincent De Oliveira). +* Add `backdrop-filter` support (by Vincent De Oliveira). +* Add `element()` support (by Vincent De Oliveira). +* Add CSS Regions support. +* Add Scroll Snap Points support. +* Add `writing-mode` support. +* Add `::backdrop` support. +* Add `cross-fade()` support. +* Add other `break-` properties support. +* Add Microsoft Edge support (by Andrey Polischuk). +* Add `not` keyword and exclude browsers by query. +* Add version ranges `IE 6-9` (by Ben Briggs). +* Fix `filter` in `transition` support on Safari. +* Fix `url()` parsing. +* Fix `pixelated` cleaning. +* Always show old gradient direction warning. + +## 5.2.1 +* Fix parent-less node issue on some cases (by Josh Gillies). + +## 5.2 “Dont tread on me” +* Add `appearance` support. +* Warn users on old gradient direction or flexbox syntax. +* Add `add: false` option to disable new prefixes adding. +* Make Autoprefixer 30% faster. +* Use PostCSS 4.1 plugin API. +* Add prefixes for `pixelated` instead of `crisp-edges` in `image-rendering`. +* Do not add `::placeholder` prefixes for `:placeholder-shown`. +* Fix `text-decoration` prefixes. +* `autoprefixer.process()` was deprecated. Use PostCSS API. + +## 5.1.11 +* Update `num2fraction` to fix resolution media query (by 一丝). + +## 5.1.10 +* Do not generate `-webkit-image-rendering`. + +## 5.1.9 +* Fix DynJS compatibility (by Nick Howes). + +## 5.1.8 +* Fix gradients in `mask` and `mask-image` properties. +* Fix old webkit prefix on some unsupported gradients. + +## 5.1.7 +* Fix placeholder selector (by Vincent De Oliveira). + +## 5.1.6 +* Use official `::placeholder-shown` selector (by Vincent De Oliveira). + +## 5.1.5 +* Add transition support for CSS Masks properties. + +## 5.1.4 +* Use `-webkit-` prefix for Opera Mobile 24. + +## 5.1.3 +* Add IE support for `image-rendering: crisp-edges`. + +## 5.1.2 +* Add never existed `@-ms-keyframes` to common mistake. + +## 5.1.1 +* Safer value split in `flex` hack. + +## 5.1 “Jianyuan” +* Add support for resolution media query (by 一丝). +* Higher accuracy while removing prefixes in values. +* Add support for logical properties (by 一丝). +* Add `@viewport` support. +* Add `text-overflow` support (by 一丝). +* Add `text-emphasis` support (by 一丝). +* Add `image-rendering: crisp-edges` support. +* Add `text-align-last` support. +* Return `autoprefixer.defaults` as alias to current `browserslist.defaults`. +* Save code style while adding prefixes to `@keyframes` and `@viewport`. +* Do not remove `-webkit-background-clip` with non-spec `text` value. +* Fix `-webkit-filter` in `transition`. +* Better support for browser versions joined on Can I Use + like `ios_saf 7.0-7.1` (by Vincent De Oliveira). +* Fix compatibility with `postcss-import` (by Jason Kuhrt). +* Fix Flexbox prefixes for BlackBerry and UC Browser. +* Fix gradient prefixes for old Chrome. + +## 5.0 “Pravda vítězí” +* Use PostCSS 4.0. +* Use Browserslist to parse browsers queries. +* Use global `browserslist` config. +* Add `> 5% in US` query to select browsers by usage in some country. +* Add `object-fit` and `object-position` properties support. +* Add CSS Shape properties support. +* Fix UC Browser name in debug info. +* Remove `autoprefixer.defaults` and use defaults from Browserslist. + +## 4.0.2 +* Remove `o-border-radius`, which is common mistake in legacy CSS. + +## 4.0.1 +* Fix `@supports` support with brackets in values (by Vincent De Oliveira). + +## 4.0 “Indivisibiliter ac Inseparabiliter” +* Become 2.5 times fatser by new PostCSS 3.0 parser. +* Do not remove outdated prefixes by `remove: false` option. +* `map.inline` and `map.sourcesContent` options are now `true` by default. +* Add `box-decoration-break` support. +* Do not add old `-webkit-` prefix for gradients with `px` units. +* Use previous source map to show origin source of CSS syntax error. +* Use `from` option from previous source map `file` field. +* Set `to` value to `from` if `to` option is missing. +* Trim Unicode BOM on source maps parsing. +* Parse at-rules without spaces like `@import"file"`. +* Better previous `sourceMappingURL` annotation comment cleaning. +* Do not remove previous `sourceMappingURL` comment on `map.annotation: false`. + +## 3.1.2 +* Update Firefox ESR version from 24 to 31. + +## 3.1.1 +* Use Flexbox 2009 spec for Android stock browser < 4.4. + +## 3.1 “Satyameva Jayate” +* Do not remove comments from prefixed values (by Eitan Rousso). +* Allow Safari 6.1 to use final Flexbox spec (by John Kreitlow). +* Fix `filter` value in `transition` in Webkits. +* Show greetings if your browsers don’t require any prefixes. +* Add `<=` and `<` browsers requirement (by Andreas Lind). + +## 3.0.1 +* Fix `autoprefixer.postcss` in callbacks. + +## 3.0 “Liberté, Égalité, Fraternité” +* Project was split to autoprefixer (with CLI) and autoprefixer-core. +* `autoprefixer()` now receives only `options` object with `browsers` key. +* GNU format for syntax error messages from PostCSS 2.2. + +## 2.2 “Mobilis in mobili” +* Allow to disable Autoprefixer for some rule by control comment. +* Use PostCSS 2.1 with Safe Mode option and broken source line + in CSS syntax error messages. + +## 2.1.1 +* Fix `-webkit-background-size` hack for `contain` and `cover` values. +* Don’t add `-webkit-` prefix to `filter` with SVG (by Vincent De Oliveira). + +## 2.1 “Eleftheria i thanatos” +* Add support for `clip-path` and `mask` properties. +* Return `-webkit-` prefix to `filter` with SVG URI. + +## 2.0.2 +* Add readable names for new browsers from 2.0 release. +* Don’t add `-webkit-` prefix to `filter` with SVG URI. +* Don’t add `-o-` prefix 3D transforms. + +## 2.0.1 +* Save declaration style, when clone declaration to prefix. + +## 2.0 “Hongik Ingan” +* Based on PostCSS 1.0. + See [options changes](https://github.com/postcss/postcss/releases/tag/1.0.0). +* Restore visual cascade after declaration removing. +* Enable visual cascade by default. +* Prefix declareation in `@supports` at-rule conditions. +* Add all browsers from Can I Use: `ie_mob`, `and_chr`, `and_ff`, + `op_mob` and `op_mini`. +* Allow to use latest Autoprefixer from GitHub by npm. +* Add `--no-cascade`, `--annotation` and `--sources-content` options to binary. + +## 1.3.1 +* Fix gradient hack, when `background` property contains color. + +## 1.3 “Tenka Fubu” +* Add `text-size-adjust` support. +* Add `background-size` to support Android 2. + +## 1.2 “Meiji” +* Use Can I Use data from official `caniuse-db` npm package. +* Remove package data update from binary. +* Use increment value instead of current date in minor versions. + +## 1.1 “Nutrisco et extingo” +* Add source map annotation comment support. +* Add inline source map support. +* Autodetect previous source map. +* Fix source maps support on Windows. +* Fix source maps support in subdirectory. +* Prefix selector even if it is already prefixed by developer. +* Add option `cascade` to create nice visual cascade of prefixes. +* Fix flexbox support for IE 10 (by Roland Warmerdam). +* Better `break-inside` support. +* Fix prefixing, when two same properties are near. + +### 20140222: +* Add `touch-action` support. + +### 20140226: +* Chrome 33 is moved to released versions. +* Add Chrome 36 data. + +### 20140302: +* Add `text-decoration-*` properties support. +* Update browsers usage statistics. +* Use new PostCSS version. + +### 20140319: +* Check already prefixed properties after current declaration. +* Normalize spaces before already prefixed check. +* Firefox 28 is moved to released versions. +* Add Firefox 31 data. +* Add some Blackberry data. + +### 20140327: +* Don’t use `-ms-transform` in `@keyframes`, because IE 9 doesn’t support + animations. +* Update BlackBerry 10 data. + +### 20140403: +* Update browsers usage statistics. +* Opera 20 is moved to released versions. +* Add Opera 22 data. + +### 20140410: +* Chrome 34 is moved to released versions. +* Add Chrome 37 data. +* Fix Chrome 36 data. + +### 20140429: +* Fix `display: inline-flex` support by 2009 spec. +* Fix old WebKit gradient converter (by Sergey Belov). +* Fix CSS 3 cursors data (by Nick Schonning). + +### 20140430: +* Separate 2D and 3D transform prefixes to clean unnecessary `-ms-` prefixes. +* Firefox 29 is moved to released versions. +* Add Firefox 32 data. + +### 20140510 +* Do not add `-ms-` prefix for `transform` with 3D functions. +* Update browsers global usage statistics. + +### 20140512 +* Remove unnecessary `-moz-` prefix for `wavy` in `text-decoration`. +* Update Safari data for font properties. + +### 20140521 +* Chrome 36 is moved to released versions. +* Add Chrome 38 data. + +### 20140523 +* Opera 21 is moved to released versions. +* Add Opera 23 data. + +### 20140605 +* Allow to parse gradients without space between color and position. +* Add iOS 8, Safari 8 and Android 4.4.3 data. +* Update browsers usage statistics. + +## 1.0 “Plus ultra” +* Source map support. +* Save origin indents and code formatting. +* Change CSS parser to PostCSS. +* Preserve vendor-prefixed properties put right after unprefixed ones. +* Rename `compile()` to `process()` and return result object, + instead of CSS string. +* Rename `inspect()` to `info()`. +* Add in binary `-d` option to specify output directory. +* Binary now will not concat output files. +* Allow to select last versions for specified browser. +* Add full browser names aliases: `firefox`, `explorer` and `blackberry`. +* Ignore case in browser names. +* Change license to MIT. +* Add prefixes inside custom at-rules. +* Add only necessary prefixes to selector inside prefixed at-rule. +* Safer backgrounds list parser in gradient hack. +* Prefix `@keyframes` inside `@media`. +* Don’t prefix values for CSS3 PIE properties. +* Binary now shows file name in syntax error. +* Use browserify to build standalone version. + +### 20131225: +* Fix deprecated API convertor. +* Add `::placeholder` support for Firefix >= 18. +* Fix vendor prefixes order. + +### 20140103: +* Add `-webkit-` prefix for `sticky` position. +* Update browsers popularity statistics. + +### 20140109: +* Add selectors and at-rules sections to debug info. +* Fix outdated prefixes cleaning. + +### 20140110: +* Add `Firefox ESR` browser requirement. +* Opera 18 is moved to released versions. +* Add Opera 20 data. + +### 20140117: +* Chrome 32 is moved to released versions. +* Add Opera 34 data. + +### 20140130: +* Fix flexbox properties names in transitions. +* Add Chrome 35 and Firefox 29 data. + +### 20140203: +* Android 4.4 stock browser and Opera 19 are moved to released versions. +* Add Opera 21 data. +* Update browsers usage statistics. + +### 20140213: +* Add case insensitive to IE’s filter hack (by Dominik Schilling). +* Improve selector prefixing in some rare cases (by Simon Lydell). +* Firefox 27 is moved to released versions. +* Add Firefox 30 data. + +## 0.8 “Unbowed, Unbent, Unbroken” +* Add more browsers to defaults ("> 1%, last 2 versions, ff 17, opera 12.1" + instead of just "last 2 browsers"). +* Keep vendor prefixes without unprefixed version (like vendor-specific hacks). +* Convert gradients to old WebKit syntax (actual for Android 2.3). +* Better support for several syntaxes with one prefix (like Flexbox and + gradients in WebKit). +* Add intrinsic and extrinsic sizing values support. +* Remove never existed prefixes from common mistakes (like -ms-transition). +* Add Opera 17 data. +* Fix selector prefixes order. +* Fix browser versions order in inspect. + +### 20130903: +* Fix old WebKit gradients convertor on rgba() colors. +* Allow to write old direction syntax in gradients. + +### 20130906: +* Fix direction syntax in radial gradients. +* Don’t prefix IE filter with modern syntax. + +### 20130911: +* Fix parsing property name with spaces. + +### 20130919: +* Fix processing custom framework prefixes (by Johannes J. Schmidt). +* Concat outputs if several files compiled to one output. +* Decrease standalone build size by removing unnecessary Binary class. +* iOS 7 is moved to released versions. +* Clean up binary code (by Simon Lydell). + +### 20130923: +* Firefox 24 is moved to released versions. + +### 20131001: +* Add support for grab, grabbing, zoom-in and zoom-out cursor values. + +### 20131006: +* Chrome 30 is moved to released versions. + +### 20131007: +* Don’t add another prefixes in rule with prefixed selector. + +### 20131009: +* Opera 17 is moved to released versions. + +### 20131015: +* Fix converting multiple gradients to old webkit syntax (by Aleksei Androsov). + +### 20131017: +* Fix @host at-rule parsing. + +### 20131020: +* IE 11 and Andrid 4.3 is moved to released versions. +* Add Opera 18 data. +* Add @namespace support. +* Sort browser versions in data file. + +### 20131029: +* Add Safari 6.1 data. +* Add fx alias for Firefox. + +### 20131104: +* Update Android future version to 4.4. +* Google Chrome 32 added to future versions list. +* Firefox 25 now is actual version, 27 and 28 added to future versions. +* Browsers statistics are updated. + +### 20131205: +* Google Chrome 33 added to future releases list. +* Google Chrome 31 moved to current releases list. + +### 20131209: +* Use old webkit gradients for old iOS and Safari (by Chad von Nau). +* Fix direction conversion for old webkit gradients (by Chad von Nau). +* Update browsers popularity statistics. + +### 20131213: +* Firefox ESR in default browsers was changed to 24 version. +* Firefox 26 was moved to current releases list. +* Firefox 28 was added to future releases list. + +## 0.7 “We Do Not Sow” +* Add vendor prefixes to selectors. +* Add ::selection and ::placeholder selectors support. +* Allow to load support data from Can I Use pull requests. +* Remove deprecated API. + +### 20130806: +* Add hyphens support. + +### 20130807: +* Add tab-size support. +* Add :fullscreen support. + +### 20130808: +* Allow to select browser versions by > and >= operator. +* Fix flex properties in transition. + +### 20130810: +* Add Firefox 25 data. + +### 20130824: +* Add Chrome 31 and 30 data. +* Fix CSS comments parsing (by vladkens). + +## 0.6 “As High As Honor” +* New faster API, which cache preprocessed data. Old API is deprecated. +* A lot of perfomance improvements. +* Add Opera 15 -webkit- prefix support. +* Update Chrome 29 and Safari 7 prefixes data. +* Add minor browsers in popularity select. +* Better syntax error messages. + +### 20130721: +* Add Chrome 30 data. + +### 20130728: +* Don’t remove non-standard -webkit-background-clip: text. +* Don’t remove IE hack on CSS parse. + +### 20130729: +* Add Opera 16 data. +* Fix “Invalid range in character class” error on Firefox. + +### 20130730: +* Fix correct clone comments inside keyframes (by Alexey Plutalov). +* Fix angle recalculation in gradients (by Roman Komarov). + +### 20130731: +* Add border-image support. + +## 0.5 “Ours is the Fury” +* Rewrite Autoprefixer to be more flexible. +* Use css, instead of Rework, to fix CSS parsing errors faster. +* Fix a lot of CSS parsing errors. + +### 20130616: +* More useful message for CSS parsing errors. +* Remove old WebKit gradient syntax. +* Fix parsing error on comment with braces. + +### 20130617: +* Remove old Mozilla border-radius. +* Don’t prefix old IE filter. +* Remove old background-clip, background-size and background-origin prefixes. +* Speed up regexps in values. +* Allow to hack property declarations. + +### 20130625: +* Convert flexbox properties to 2009 and 2012 specifications. +* Improve messages on syntax errors. + +### 20130626: +* Add Firefox 24 data. +* Add prefixes for font-feature-settings. + +### 20130629: +* Fix convert flex properties to old box-flex. + +## 0.4 “Winter Is Coming” +* Remove outdated prefixes. +* Add border-radius and box-shadow properties to database. +* Change degrees in webkit gradients. + +### 20130515: +* Add old syntax in gradient direction. +* Add old syntax for display: flex. +* Update browser global usage statistics. + +### 20130521: +* Add Firefox 23 data. + +### 20130524: +* Add Chrome 29 data. + +### 20130528: +* Fix compatibilty with Rework from git master. +* Add minor browsers to data, which can be selected only directly. + +### 20130530: +* Add Opera 15 and iOS 6.1 data. +* Fix iOS versions in properties and values data. + +### 20130603: +* Use latest Rework 0.15 with a lot of CSS parsing fixes. +* Update browsers usage statistics. + +## 0.3 “Growing Strong” +* Rename `autoprefixer.filter()` to `autoprefixer.rework()`. +* Use own filters instead of Rework’s `prefix` and `prefixValue`. +* Smarter value prefixer without false match “order” in “border”. +* 40% faster. +* Don’t add unnecessary properties instead of Rework’s `prefixValue`. +* Don’t change properties order. +* Sort properties and values in inspect output. +* Add main to component config (by Jonathan Ong). +* Fix documentation (by Sergey Leschina and Mark Vasilkov). + +### 20130424: +* Fix value override in prefixer. + +### 20130427: +* Prefix several same values in one property. +* Fix Windows support in binary. +* Improve print errors in binary. + +### 20130502: +* Don’t add -webkit- prefix to IE filter. +* Don’t duplicate prefixes on second run. + +## 0.2 “Hear Me Roar!” +* Update parse libraries. +* Use component package manager to build standalone script. +* Add inspect to standalone script. + +## 0.1 “Fire and Blood” +* Initial release. diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/LICENSE b/node_modules/rucksack-css/node_modules/autoprefixer/LICENSE new file mode 100644 index 00000000..da057b45 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2013 Andrey Sitnik + +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. diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/README.md b/node_modules/rucksack-css/node_modules/autoprefixer/README.md new file mode 100644 index 00000000..2729c145 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/README.md @@ -0,0 +1,628 @@ +# Autoprefixer [![Build Status][ci-img]][ci] + + + +[PostCSS] plugin to parse CSS and add vendor prefixes to CSS rules using values +from [Can I Use]. It is [recommended] by Google and used in Twitter and Taobao. + +Write your CSS rules without vendor prefixes (in fact, forget about them +entirely): + +```css +:fullscreen a { + display: flex; +} +``` + +Autoprefixer will use the data based on current browser popularity and property +support to apply prefixes for you. You can try the [interactive demo] +of Autoprefixer. + +```css +:-webkit-full-screen a { + display: -webkit-box; + display: flex; +} +:-moz-full-screen a { + display: flex; +} +:-ms-fullscreen a { + display: -ms-flexbox; + display: flex; +} +:fullscreen a { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} +``` + +Twitter account for news and releases: [@autoprefixer]. + + +Sponsored by Evil Martians + + +[interactive demo]: http://autoprefixer.github.io/ +[@autoprefixer]: https://twitter.com/autoprefixer +[recommended]: https://developers.google.com/web/tools/setup/setup-buildtools#dont_trip_up_with_vendor_prefixes +[Can I Use]: http://caniuse.com/ +[PostCSS]: https://github.com/postcss/postcss +[ci-img]: https://travis-ci.org/postcss/autoprefixer.svg +[ci]: https://travis-ci.org/postcss/autoprefixer + +## Features + +### Write Pure CSS + +Working with Autoprefixer is simple: just forget about vendor prefixes +and write normal CSS according to the latest W3C specs. You don’t need +a special language (like Sass) or remember where you must use mixins. + +Autoprefixer supports selectors (like `:fullscreen` and `::selection`), +unit function (`calc()`), at‑rules (`@supports` and `@keyframes`) +and properties. + +Because Autoprefixer is a postprocessor for CSS, +you can also use it with preprocessors such as Sass, Stylus or LESS. + +### Flexbox, Filters, etc. + +Just write normal CSS according to the latest W3C specs and Autoprefixer +will produce the code for old browsers. + +```css +a { + display: flex; +} +``` + +compiles to: + +```css +a { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} +``` + +Autoprefixer has [27 special hacks] to fix web browser differences. + +[27 special hacks]: https://github.com/postcss/autoprefixer/tree/master/lib/hacks + +### Only Actual Prefixes + +Autoprefixer utilizes the most recent data from [Can I Use] +to add only necessary vendor prefixes. + +It also removes old, unnecessary prefixes from your CSS +(like `border-radius` prefixes, produced by many CSS libraries). + +```css +a { + -webkit-border-radius: 5px; + border-radius: 5px; +} +``` + +compiles to: + +```css +a { + border-radius: 5px; +} +``` + +[Can I Use]: http://caniuse.com/ + +## Browsers + +Autoprefixer uses [Browserslist], so you can specify the browsers +you want to target in your project by queries like `last 2 versions` +or `> 5%`. + +The best way to provide browsers is `.browserslistrc` config +or `package.json` with `browserslist` key. Put it in your project root. + +We recommend to avoid Autoprefixer option and use `.browserslistrc` config +or `package.json`. In this case browsers will be shared with other tools +like [babel-preset-env] or [Stylelint]. + +See [Browserslist docs] for queries, browser names, config format, +and default value. + +[Browserslist docs]: https://github.com/ai/browserslist#queries +[babel-preset-env]: https://github.com/babel/babel-preset-env +[Browserslist]: https://github.com/ai/browserslist +[Stylelint]: http://stylelint.io/ + +## Outdated Prefixes + +By default, Autoprefixer also removes outdated prefixes. + +You can disable this behavior with the `remove: false` option. If you have +no legacy code, this option will make Autoprefixer about 10% faster. + +Also, you can set the `add: false` option. Autoprefixer will only clean outdated +prefixes, but will not add any new prefixes. + +Autoprefixer adds new prefixes between any unprefixed properties and already +written prefixes in your CSS. If it will break the expected prefixes order, +you can clean all prefixes from your CSS and then +add the necessary prefixes again: + +```js +var cleaner = postcss([ autoprefixer({ add: false, browsers: [] }) ]); +var prefixer = postcss([ autoprefixer ]); + +cleaner.process(css).then(function (cleaned) { + return prefixer.process(cleaned.css); +}).then(function (result) { + console.log(result.css); +}); +``` + +## FAQ + +#### No prefixes in production + +Many other tools contain Autoprefixer. For example, webpack uses Autoprefixer +to minify CSS by cleaning unnecessary prefixes. + +If you set browsers list to Autoprefixer by `browsers` option, only first +Autoprefixer will know your browsers. Autoprefixer inside webpack will use +default browsers list. As result, webpack will remove prefixes, that first +Autoprefixer added. + +You need to put your browsers to [`browserslist` config] in project root — +as result all tools (Autoprefixer, cssnano, doiuse, cssnext) will use same +browsers list. + +[`browserslist` config]: https://github.com/ai/browserslist#config-file + +#### What is unprefixed version for `-webkit-min-device-pixel-ratio`? + +```css +@media (min-resolution: 2dppx) { + .image { + background-image: url(image@2x.png); + } +} +``` + +Will be compiled to: + +```css +@media (-webkit-min-device-pixel-ratio: 2), + (-o-min-device-pixel-ratio: 2/1), + (min-resolution: 2dppx) { + .image { + background-image: url(image@2x.png); + } +} +``` + +#### Does it add polyfills? + +No. Autoprefixer only adds prefixes. + +Most new CSS features will require client side JavaScript to handle a new +behavior correctly. + +Depending on what you consider to be a “polyfill”, you can take a look at some +other tools and libraries. If you are just looking for syntax sugar, +you might take a look at: + +- [Oldie], a PostCSS plugin that handles some IE hacks (opacity, rgba, etc). +- [postcss-flexbugs-fixes], a PostCSS plugin to fix flexbox issues. +- [cssnext], a tool that allows you to write standard CSS syntax non-implemented + yet in browsers (custom properties, custom media, color functions, etc). + +[postcss-flexbugs-fixes]: https://github.com/luisrudge/postcss-flexbugs-fixes +[cssnext]: https://github.com/MoOx/postcss-cssnext +[Oldie]: https://github.com/jonathantneal/oldie + +#### Why doesn’t Autoprefixer add prefixes to `border-radius`? + +Developers are often surprised by how few prefixes are required today. +If Autoprefixer doesn’t add prefixes to your CSS, check if they’re still +required on [Can I Use]. + +There is a [list with all supported] properties, values, and selectors. + +[list with all supported]: https://github.com/postcss/autoprefixer/wiki/support-list +[Can I Use]: http://caniuse.com/ + +#### Why Autoprefixer uses unprefixed properties in `@-webkit-keyframes`? + +Browser teams can remove some prefixes before others. So we try to use +all combinations of prefixed/unprefixed values. + +#### How to work with legacy `-webkit-` only code? + +Autoprefixer needs unprefixed property to add prefixes. So if you only +wrote `-webkit-gradient` without W3C’s `gradient`, +Autoprefixer will not add other prefixes. + +But [PostCSS] has a plugins to convert CSS to unprefixed state. +Use [postcss-unprefix] before Autoprefixer. + +[postcss-unprefix]: https://github.com/gucong3000/postcss-unprefix + +#### Does Autoprefixer add `-epub-` prefix? + +No, Autoprefixer works only with browsers prefixes from Can I Use. +But you can use [postcss-epub](https://github.com/Rycochet/postcss-epub) +for prefixing ePub3 properties. + +#### Why doesn’t Autoprefixer transform generic font-family `system-ui`? + +`system-ui` is technically not a prefix and the transformation is not future-proof. But you can use [postcss-font-family-system-ui](https://github.com/JLHwung/postcss-font-family-system-ui) to transform `system-ui` to a practical font-family list. + +## Usage + +### Gulp + +In Gulp you can use [gulp-postcss] with `autoprefixer` npm package. + +```js +gulp.task('autoprefixer', function () { + var postcss = require('gulp-postcss'); + var sourcemaps = require('gulp-sourcemaps'); + var autoprefixer = require('autoprefixer'); + + return gulp.src('./src/*.css') + .pipe(sourcemaps.init()) + .pipe(postcss([ autoprefixer() ])) + .pipe(sourcemaps.write('.')) + .pipe(gulp.dest('./dest')); +}); +``` + +With `gulp-postcss` you also can combine Autoprefixer +with [other PostCSS plugins]. + +[other PostCSS plugins]: https://github.com/postcss/postcss#plugins +[gulp-postcss]: https://github.com/postcss/gulp-postcss + +### Webpack + +In [webpack] you can use [postcss-loader] with `autoprefixer` +and [other PostCSS plugins]. + +```js +module.exports = { + module: { + rules: [ + { + test: /\.css$/, + use: ["style-loader", "css-loader", "postcss-loader"] + } + ] + } +} +``` + +And create a `postcss.config.js` with: + +```js +module.exports = { + plugins: [ + require('autoprefixer') + ] +} +``` + +[other PostCSS plugins]: https://github.com/postcss/postcss#plugins +[postcss-loader]: https://github.com/postcss/postcss-loader +[webpack]: http://webpack.github.io/ + +### Grunt + +In Grunt you can use [grunt-postcss] with `autoprefixer` npm package. + +```js +module.exports = function(grunt) { + grunt.loadNpmTasks('grunt-postcss'); + + grunt.initConfig({ + postcss: { + options: { + map: true, + processors: [ + require('autoprefixer') + ] + }, + dist: { + src: 'css/*.css' + } + } + }); + + grunt.registerTask('default', ['postcss:dist']); +}; +``` + +With `grunt-postcss` you also can combine Autoprefixer +with [other PostCSS plugins]. + +[other PostCSS plugins]: https://github.com/postcss/postcss#plugins +[grunt-postcss]: https://github.com/nDmitry/grunt-postcss + +### Other Build Tools: + +* **Ruby on Rails**: [autoprefixer-rails] +* **Neutrino**: [neutrino-middleware-postcss] +* **Jekyll**: add `autoprefixer-rails` and `jekyll-assets` to `Gemfile` +* **Brunch**: [postcss-brunch] +* **Broccoli**: [broccoli-postcss] +* **Middleman**: [middleman-autoprefixer] +* **Mincer**: add `autoprefixer` npm package and enable it: + `environment.enable('autoprefixer')` + +[neutrino-middleware-postcss]: https://www.npmjs.com/package/neutrino-middleware-postcss +[middleman-autoprefixer]: https://github.com/middleman/middleman-autoprefixer +[autoprefixer-rails]: https://github.com/ai/autoprefixer-rails +[broccoli-postcss]: https://github.com/jeffjewiss/broccoli-postcss +[postcss-brunch]: https://github.com/iamvdo/postcss-brunch + +### Preprocessors + +* **Less**: [less-plugin-autoprefix] +* **Stylus**: [autoprefixer-stylus] +* **Compass**: [autoprefixer-rails#compass] + +[less-plugin-autoprefix]: https://github.com/less/less-plugin-autoprefix +[autoprefixer-stylus]: https://github.com/jenius/autoprefixer-stylus +[autoprefixer-rails#compass]: https://github.com/ai/autoprefixer-rails#compass + +### CSS-in-JS + +There is [postcss-js] to use Autoprefixer in React Inline Styles, [Free Style], +Radium and other CSS-in-JS solutions. + +```js +let prefixer = postcssJs.sync([ autoprefixer ]); +let style = prefixer({ + display: 'flex' +}); +``` + +[postcss-js]: https://github.com/postcss/postcss-js +[Free Style]: https://github.com/blakeembrey/free-style + +### GUI Tools + +* [CodeKit](https://codekitapp.com/help/autoprefixer/) +* [Prepros](https://prepros.io) + +### CLI + +You can use the [postcss-cli] to run Autoprefixer from CLI: + +```sh +npm install postcss-cli autoprefixer +npx postcss *.css --use autoprefixer -d build/ +``` + +See `postcss -h` for help. + +[postcss-cli]: https://github.com/postcss/postcss-cli + +### JavaScript + +You can use Autoprefixer with [PostCSS] in your Node.js application +or if you want to develop an Autoprefixer plugin for new environment. + +```js +var autoprefixer = require('autoprefixer'); +var postcss = require('postcss'); + +postcss([ autoprefixer ]).process(css).then(function (result) { + result.warnings().forEach(function (warn) { + console.warn(warn.toString()); + }); + console.log(result.css); +}); +``` + +There is also [standalone build] for the browser or as a non-Node.js runtime. + +You can use [html-autoprefixer] to process HTML with inlined CSS. + +[html-autoprefixer]: https://github.com/RebelMail/html-autoprefixer +[standalone build]: https://raw.github.com/ai/autoprefixer-rails/master/vendor/autoprefixer.js +[PostCSS]: https://github.com/postcss/postcss + +### Text Editors and IDE + +Autoprefixer should be used in assets build tools. Text editor plugins are not +a good solution, because prefixes decrease code readability and you will need +to change value in all prefixed properties. + +I recommend you to learn how to use build tools like [Gulp]. +They work much better and will open you a whole new world of useful plugins +and automatization. + +But, if you can’t move to a build tool, you can use text editor plugins: + +* [Sublime Text](https://github.com/sindresorhus/sublime-autoprefixer) +* [Brackets](https://github.com/mikaeljorhult/brackets-autoprefixer) +* [Atom Editor](https://github.com/sindresorhus/atom-autoprefixer) +* [Visual Studio](http://vswebessentials.com/) + +[Gulp]: http://gulpjs.com/ + +## Warnings + +Autoprefixer uses the [PostCSS warning API] to warn about really important problems +in your CSS: + +* Old direction syntax in gradients. +* Old unprefixed `display: box` instead of `display: flex` + by latest specification version. + +You can get warnings from `result.warnings()`: + +```js +result.warnings().forEach(function (warn) { + console.warn(warn.toString()); +}); +``` + +Every Autoprefixer runner should display this warnings. + +[PostCSS warning API]: https://github.com/postcss/postcss/blob/master/docs/api.md#warning-class + +## Disabling + +### Prefixes + +Autoprefixer was designed to have no interface – it just works. +If you need some browser specific hack just write a prefixed property +after the unprefixed one. + +```css +a { + transform: scale(0.5); + -moz-transform: scale(0.6); +} +``` + +If some prefixes were generated in a wrong way, +please create an issue on GitHub. + +### Features + +There are 4 plugin’s options to disable some Autoprefixer features. + +* `supports: false` will disable `@supports` parameters prefixing. +* `flexbox: false` will disable flexbox properties prefixing. + Or `flexbox: "no-2009"` will add prefixes only for final and IE + versions of specification. +* `remove: false` will disable cleaning outdated prefixes. + +You shoud set them to the plugin: + +```js +autoprefixer({ grid: true }); +``` + +### Control Comments + +If you do not need Autoprefixer in some part of your CSS, +you can use control comments to disable Autoprefixer. + +```css +a { + transition: 1s; /* it will be prefixed */ +} + +b { + /* autoprefixer: off */ + transition: 1s; /* it will not be prefixed */ +} +``` + +Control comments disable Autoprefixer within the whole rule in which +you place it. In the above example, Autoprefixer will be disabled +in the entire `b` rule scope, not only after the comment. + +You can also use comments recursively: + +```css +/* autoprefixer: off */ +@supports (transition: all) { + /* autoprefixer: on */ + a { + /* autoprefixer: off */ + } +} +``` + +In Sass/SCSS you can use all the disable options above, add an exclamation mark +in the start of comment: `/*! autoprefixer: off */`. + +## Options + +Function `autoprefixer(options)` returns new PostCSS plugin. +See [PostCSS API] for plugin usage documentation. + +```js +autoprefixer({ cascade: false }) +``` + +There are 8 options: + +* `browsers` (array): list of browsers query (like `last 2 versions`), + which are supported in your project. We recommend to use `browserslist` + config or `browserslist` key in `package.json`, rather than this option + to share browsers with other tools. See [Browserslist docs] for available + queries and default value. +* `env` (string): environment for Browserslist. +* `cascade` (boolean): should Autoprefixer use Visual Cascade, + if CSS is uncompressed. Default: `true` +* `add` (boolean): should Autoprefixer add prefixes. Default is `true`. +* `remove` (boolean): should Autoprefixer [remove outdated] prefixes. + Default is `true`. +* `supports` (boolean): should Autoprefixer add prefixes for `@supports` + parameters. Default is `true`. +* `flexbox` (boolean|string): should Autoprefixer add prefixes for flexbox + properties. With `"no-2009"` value Autoprefixer will add prefixes only + for final and IE versions of specification. Default is `true`. +* `grid` (boolean): should Autoprefixer add IE prefixes for Grid Layout + properties. Default is `false`. +* `stats` (object): custom [usage statistics] for `> 10% in my stats` + browsers query. + +Plugin object has `info()` method for debugging purpose. + +You can use PostCSS processor to process several CSS files +to increase performance. + +[usage statistics]: https://github.com/ai/browserslist#custom-usage-data +[PostCSS API]: http://api.postcss.org + +## Debug + +Run `npx autoprefixer-info --package autoprefixer` in your project directory to check +which browsers are selected and which properties will be prefixed: + +``` +$ npx autoprefixer-info --package autoprefixer +Browsers: + Edge: 16 + +These browsers account for 0.04% of all users globally + +At-Rules: + @viewport: ms + +Selectors: + ::placeholder: ms + +Properties: + user-select: ms + hyphens: ms + appearance: webkit + scroll-snap-type: ms + scroll-snap-coordinate: ms + scroll-snap-destination: ms + scroll-snap-points-x: ms + scroll-snap-points-y: ms + flow-into: ms + flow-from: ms + region-fragment: ms + text-spacing: ms +``` + +JS API is also available: + +```js +var info = autoprefixer().info(); +console.log(info); +``` diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/bin/autoprefixer-info b/node_modules/rucksack-css/node_modules/autoprefixer/bin/autoprefixer-info new file mode 100755 index 00000000..c9f5fbf5 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/bin/autoprefixer-info @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +process.stdout.write(require('../')().info() + '\n'); diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/data/prefixes.js b/node_modules/rucksack-css/node_modules/autoprefixer/data/prefixes.js new file mode 100644 index 00000000..229410ae --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/data/prefixes.js @@ -0,0 +1,705 @@ +'use strict'; + +var unpack = require('caniuse-lite').feature; + +var browsersSort = function browsersSort(a, b) { + a = a.split(' '); + b = b.split(' '); + if (a[0] > b[0]) { + return 1; + } else if (a[0] < b[0]) { + return -1; + } else { + return Math.sign(parseFloat(a[1]) - parseFloat(b[1])); + } +}; + +// Convert Can I Use data +function f(data, opts, callback) { + data = unpack(data); + + if (!callback) { + var _ref = [opts, {}]; + callback = _ref[0]; + opts = _ref[1]; + } + + var match = opts.match || /\sx($|\s)/; + var need = []; + + for (var browser in data.stats) { + var versions = data.stats[browser]; + for (var version in versions) { + var support = versions[version]; + if (support.match(match)) { + need.push(browser + ' ' + version); + } + } + } + + callback(need.sort(browsersSort)); +} + +// Add data for all properties +var result = {}; + +var prefix = function prefix(names, data) { + for (var _iterator = names, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var name = _ref2; + + result[name] = Object.assign({}, data); + } +}; + +var add = function add(names, data) { + for (var _iterator2 = names, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + var name = _ref3; + + result[name].browsers = result[name].browsers.concat(data.browsers).sort(browsersSort); + } +}; + +module.exports = result; + +// Border Radius +f(require('caniuse-lite/data/features/border-radius.js'), function (browsers) { + return prefix(['border-radius', 'border-top-left-radius', 'border-top-right-radius', 'border-bottom-right-radius', 'border-bottom-left-radius'], { + mistakes: ['-khtml-', '-ms-', '-o-'], + feature: 'border-radius', + browsers: browsers + }); +}); + +// Box Shadow +f(require('caniuse-lite/data/features/css-boxshadow.js'), function (browsers) { + return prefix(['box-shadow'], { + mistakes: ['-khtml-'], + feature: 'css-boxshadow', + browsers: browsers + }); +}); + +// Animation +f(require('caniuse-lite/data/features/css-animation.js'), function (browsers) { + return prefix(['animation', 'animation-name', 'animation-duration', 'animation-delay', 'animation-direction', 'animation-fill-mode', 'animation-iteration-count', 'animation-play-state', 'animation-timing-function', '@keyframes'], { + mistakes: ['-khtml-', '-ms-'], + feature: 'css-animation', + browsers: browsers + }); +}); + +// Transition +f(require('caniuse-lite/data/features/css-transitions.js'), function (browsers) { + return prefix(['transition', 'transition-property', 'transition-duration', 'transition-delay', 'transition-timing-function'], { + mistakes: ['-khtml-', '-ms-'], + browsers: browsers, + feature: 'css-transitions' + }); +}); + +// Transform 2D +f(require('caniuse-lite/data/features/transforms2d.js'), function (browsers) { + return prefix(['transform', 'transform-origin'], { + feature: 'transforms2d', + browsers: browsers + }); +}); + +// Transform 3D +var transforms3d = require('caniuse-lite/data/features/transforms3d.js'); + +f(transforms3d, function (browsers) { + prefix(['perspective', 'perspective-origin'], { + feature: 'transforms3d', + browsers: browsers + }); + return prefix(['transform-style'], { + mistakes: ['-ms-', '-o-'], + browsers: browsers, + feature: 'transforms3d' + }); +}); + +f(transforms3d, { match: /y\sx|y\s#2/ }, function (browsers) { + return prefix(['backface-visibility'], { + mistakes: ['-ms-', '-o-'], + feature: 'transforms3d', + browsers: browsers + }); +}); + +// Gradients +var gradients = require('caniuse-lite/data/features/css-gradients.js'); + +f(gradients, { match: /y\sx/ }, function (browsers) { + return prefix(['linear-gradient', 'repeating-linear-gradient', 'radial-gradient', 'repeating-radial-gradient'], { + props: ['background', 'background-image', 'border-image', 'mask', 'list-style', 'list-style-image', 'content', 'mask-image'], + mistakes: ['-ms-'], + feature: 'css-gradients', + browsers: browsers + }); +}); + +f(gradients, { match: /a\sx/ }, function (browsers) { + browsers = browsers.map(function (i) { + if (/op/.test(i)) { + return i; + } else { + return i + ' old'; + } + }); + return add(['linear-gradient', 'repeating-linear-gradient', 'radial-gradient', 'repeating-radial-gradient'], { + feature: 'css-gradients', + browsers: browsers + }); +}); + +// Box sizing +f(require('caniuse-lite/data/features/css3-boxsizing.js'), function (browsers) { + return prefix(['box-sizing'], { + feature: 'css3-boxsizing', + browsers: browsers + }); +}); + +// Filter Effects +f(require('caniuse-lite/data/features/css-filters.js'), function (browsers) { + return prefix(['filter'], { + feature: 'css-filters', + browsers: browsers + }); +}); + +// filter() function +f(require('caniuse-lite/data/features/css-filter-function.js'), function (browsers) { + return prefix(['filter-function'], { + props: ['background', 'background-image', 'border-image', 'mask', 'list-style', 'list-style-image', 'content', 'mask-image'], + feature: 'css-filter-function', + browsers: browsers + }); +}); + +// Backdrop-filter +f(require('caniuse-lite/data/features/css-backdrop-filter.js'), function (browsers) { + return prefix(['backdrop-filter'], { + feature: 'css-backdrop-filter', + browsers: browsers + }); +}); + +// element() function +f(require('caniuse-lite/data/features/css-element-function.js'), function (browsers) { + return prefix(['element'], { + props: ['background', 'background-image', 'border-image', 'mask', 'list-style', 'list-style-image', 'content', 'mask-image'], + feature: 'css-element-function', + browsers: browsers + }); +}); + +// Multicolumns +f(require('caniuse-lite/data/features/multicolumn.js'), function (browsers) { + prefix(['columns', 'column-width', 'column-gap', 'column-rule', 'column-rule-color', 'column-rule-width'], { + feature: 'multicolumn', + browsers: browsers + }); + + prefix(['column-count', 'column-rule-style', 'column-span', 'column-fill', 'break-before', 'break-after', 'break-inside'], { + feature: 'multicolumn', + browsers: browsers + }); +}); + +// User select +f(require('caniuse-lite/data/features/user-select-none.js'), function (browsers) { + return prefix(['user-select'], { + mistakes: ['-khtml-'], + feature: 'user-select-none', + browsers: browsers + }); +}); + +// Flexible Box Layout +var flexbox = require('caniuse-lite/data/features/flexbox.js'); +f(flexbox, { match: /a\sx/ }, function (browsers) { + browsers = browsers.map(function (i) { + if (/ie|firefox/.test(i)) { + return i; + } else { + return i + ' 2009'; + } + }); + prefix(['display-flex', 'inline-flex'], { + props: ['display'], + feature: 'flexbox', + browsers: browsers + }); + prefix(['flex', 'flex-grow', 'flex-shrink', 'flex-basis'], { + feature: 'flexbox', + browsers: browsers + }); + prefix(['flex-direction', 'flex-wrap', 'flex-flow', 'justify-content', 'order', 'align-items', 'align-self', 'align-content'], { + feature: 'flexbox', + browsers: browsers + }); +}); + +f(flexbox, { match: /y\sx/ }, function (browsers) { + add(['display-flex', 'inline-flex'], { + feature: 'flexbox', + browsers: browsers + }); + add(['flex', 'flex-grow', 'flex-shrink', 'flex-basis'], { + feature: 'flexbox', + browsers: browsers + }); + add(['flex-direction', 'flex-wrap', 'flex-flow', 'justify-content', 'order', 'align-items', 'align-self', 'align-content'], { + feature: 'flexbox', + browsers: browsers + }); +}); + +// calc() unit +f(require('caniuse-lite/data/features/calc.js'), function (browsers) { + return prefix(['calc'], { + props: ['*'], + feature: 'calc', + browsers: browsers + }); +}); + +// Background options +f(require('caniuse-lite/data/features/background-img-opts.js'), function (browsers) { + return prefix(['background-clip', 'background-origin', 'background-size'], { + feature: 'background-img-opts', + browsers: browsers + }); +}); + +// Font feature settings +f(require('caniuse-lite/data/features/font-feature.js'), function (browsers) { + return prefix(['font-feature-settings', 'font-variant-ligatures', 'font-language-override'], { + feature: 'font-feature', + browsers: browsers + }); +}); + +// CSS font-kerning property +f(require('caniuse-lite/data/features/font-kerning.js'), function (browsers) { + return prefix(['font-kerning'], { + feature: 'font-kerning', + browsers: browsers + }); +}); + +// Border image +f(require('caniuse-lite/data/features/border-image.js'), function (browsers) { + return prefix(['border-image'], { + feature: 'border-image', + browsers: browsers + }); +}); + +// Selection selector +f(require('caniuse-lite/data/features/css-selection.js'), function (browsers) { + return prefix(['::selection'], { + selector: true, + feature: 'css-selection', + browsers: browsers + }); +}); + +// Placeholder selector +f(require('caniuse-lite/data/features/css-placeholder.js'), function (browsers) { + browsers = browsers.map(function (i) { + var _i$split = i.split(' '), + name = _i$split[0], + version = _i$split[1]; + + if (name === 'firefox' && parseFloat(version) <= 18) { + return i + ' old'; + } else if (name === 'ie') { + return i + ' old'; + } else { + return i; + } + }); + + prefix(['::placeholder'], { + selector: true, + feature: 'css-placeholder', + browsers: browsers + }); +}); + +// Hyphenation +f(require('caniuse-lite/data/features/css-hyphens.js'), function (browsers) { + return prefix(['hyphens'], { + feature: 'css-hyphens', + browsers: browsers + }); +}); + +// Fullscreen selector +var fullscreen = require('caniuse-lite/data/features/fullscreen.js'); + +f(fullscreen, function (browsers) { + return prefix([':fullscreen'], { + selector: true, + feature: 'fullscreen', + browsers: browsers + }); +}); + +f(fullscreen, { match: /x(\s#2|$)/ }, function (browsers) { + return prefix(['::backdrop'], { + selector: true, + feature: 'fullscreen', + browsers: browsers + }); +}); + +// Tab size +f(require('caniuse-lite/data/features/css3-tabsize.js'), function (browsers) { + return prefix(['tab-size'], { + feature: 'css3-tabsize', + browsers: browsers + }); +}); + +// Intrinsic & extrinsic sizing +f(require('caniuse-lite/data/features/intrinsic-width.js'), function (browsers) { + return prefix(['max-content', 'min-content', 'fit-content', 'fill', 'fill-available', 'stretch'], { + props: ['width', 'min-width', 'max-width', 'height', 'min-height', 'max-height', 'inline-size', 'min-inline-size', 'max-inline-size', 'block-size', 'min-block-size', 'max-block-size', 'grid', 'grid-template', 'grid-template-rows', 'grid-template-columns', 'grid-auto-columns', 'grid-auto-rows'], + feature: 'intrinsic-width', + browsers: browsers + }); +}); + +// Zoom cursors +f(require('caniuse-lite/data/features/css3-cursors-newer.js'), function (browsers) { + return prefix(['zoom-in', 'zoom-out'], { + props: ['cursor'], + feature: 'css3-cursors-newer', + browsers: browsers + }); +}); + +// Grab cursors +f(require('caniuse-lite/data/features/css3-cursors-grab.js'), function (browsers) { + return prefix(['grab', 'grabbing'], { + props: ['cursor'], + feature: 'css3-cursors-grab', + browsers: browsers + }); +}); + +// Sticky position +f(require('caniuse-lite/data/features/css-sticky.js'), function (browsers) { + return prefix(['sticky'], { + props: ['position'], + feature: 'css-sticky', + browsers: browsers + }); +}); + +// Pointer Events +f(require('caniuse-lite/data/features/pointer.js'), function (browsers) { + return prefix(['touch-action'], { + feature: 'pointer', + browsers: browsers + }); +}); + +// Text decoration +var decoration = require('caniuse-lite/data/features/text-decoration.js'); + +f(decoration, function (browsers) { + return prefix(['text-decoration-style', 'text-decoration-color', 'text-decoration-line', 'text-decoration'], { + feature: 'text-decoration', + browsers: browsers + }); +}); + +f(decoration, { match: /x.*#[23]/ }, function (browsers) { + return prefix(['text-decoration-skip'], { + feature: 'text-decoration', + browsers: browsers + }); +}); + +// Text Size Adjust +f(require('caniuse-lite/data/features/text-size-adjust.js'), function (browsers) { + return prefix(['text-size-adjust'], { + feature: 'text-size-adjust', + browsers: browsers + }); +}); + +// CSS Masks +f(require('caniuse-lite/data/features/css-masks.js'), function (browsers) { + prefix(['mask-clip', 'mask-composite', 'mask-image', 'mask-origin', 'mask-repeat', 'mask-border-repeat', 'mask-border-source'], { + feature: 'css-masks', + browsers: browsers + }); + prefix(['mask', 'mask-position', 'mask-size', 'mask-border', 'mask-border-outset', 'mask-border-width', 'mask-border-slice'], { + feature: 'css-masks', + browsers: browsers + }); +}); + +// CSS clip-path property +f(require('caniuse-lite/data/features/css-clip-path.js'), function (browsers) { + return prefix(['clip-path'], { + feature: 'css-clip-path', + browsers: browsers + }); +}); + +// Fragmented Borders and Backgrounds +f(require('caniuse-lite/data/features/css-boxdecorationbreak.js'), function (browsers) { + return prefix(['box-decoration-break'], { + feature: 'css-boxdecorationbreak', + browsers: browsers + }); +}); + +// CSS3 object-fit/object-position +f(require('caniuse-lite/data/features/object-fit.js'), function (browsers) { + return prefix(['object-fit', 'object-position'], { + feature: 'object-fit', + browsers: browsers + }); +}); + +// CSS Shapes +f(require('caniuse-lite/data/features/css-shapes.js'), function (browsers) { + return prefix(['shape-margin', 'shape-outside', 'shape-image-threshold'], { + feature: 'css-shapes', + browsers: browsers + }); +}); + +// CSS3 text-overflow +f(require('caniuse-lite/data/features/text-overflow.js'), function (browsers) { + return prefix(['text-overflow'], { + feature: 'text-overflow', + browsers: browsers + }); +}); + +// Viewport at-rule +f(require('caniuse-lite/data/features/css-deviceadaptation.js'), function (browsers) { + return prefix(['@viewport'], { + feature: 'css-deviceadaptation', + browsers: browsers + }); +}); + +// Resolution Media Queries +var resolut = require('caniuse-lite/data/features/css-media-resolution.js'); +f(resolut, { match: /( x($| )|a #3)/ }, function (browsers) { + return prefix(['@resolution'], { + feature: 'css-media-resolution', + browsers: browsers + }); +}); + +// CSS text-align-last +f(require('caniuse-lite/data/features/css-text-align-last.js'), function (browsers) { + return prefix(['text-align-last'], { + feature: 'css-text-align-last', + browsers: browsers + }); +}); + +// Crisp Edges Image Rendering Algorithm +var crispedges = require('caniuse-lite/data/features/css-crisp-edges.js'); + +f(crispedges, { match: /y x|a x #1/ }, function (browsers) { + return prefix(['pixelated'], { + props: ['image-rendering'], + feature: 'css-crisp-edges', + browsers: browsers + }); +}); + +f(crispedges, { match: /a x #2/ }, function (browsers) { + return prefix(['image-rendering'], { + feature: 'css-crisp-edges', + browsers: browsers + }); +}); + +// Logical Properties +var logicalProps = require('caniuse-lite/data/features/css-logical-props.js'); + +f(logicalProps, function (browsers) { + return prefix(['border-inline-start', 'border-inline-end', 'margin-inline-start', 'margin-inline-end', 'padding-inline-start', 'padding-inline-end'], { + feature: 'css-logical-props', + browsers: browsers + }); +}); + +f(logicalProps, { match: /x\s#2/ }, function (browsers) { + return prefix(['border-block-start', 'border-block-end', 'margin-block-start', 'margin-block-end', 'padding-block-start', 'padding-block-end'], { + feature: 'css-logical-props', + browsers: browsers + }); +}); + +// CSS appearance +var appearance = require('caniuse-lite/data/features/css-appearance.js'); +f(appearance, { match: /#2|x/ }, function (browsers) { + return prefix(['appearance'], { + feature: 'css-appearance', + browsers: browsers + }); +}); + +// CSS Scroll snap points +f(require('caniuse-lite/data/features/css-snappoints.js'), function (browsers) { + return prefix(['scroll-snap-type', 'scroll-snap-coordinate', 'scroll-snap-destination', 'scroll-snap-points-x', 'scroll-snap-points-y'], { + feature: 'css-snappoints', + browsers: browsers + }); +}); + +// CSS Regions +f(require('caniuse-lite/data/features/css-regions.js'), function (browsers) { + return prefix(['flow-into', 'flow-from', 'region-fragment'], { + feature: 'css-regions', + browsers: browsers + }); +}); + +// CSS image-set +f(require('caniuse-lite/data/features/css-image-set.js'), function (browsers) { + return prefix(['image-set'], { + props: ['background', 'background-image', 'border-image', 'cursor', 'mask', 'mask-image', 'list-style', 'list-style-image', 'content'], + feature: 'css-image-set', + browsers: browsers + }); +}); + +// Writing Mode +var writingMode = require('caniuse-lite/data/features/css-writing-mode.js'); +f(writingMode, { match: /a|x/ }, function (browsers) { + return prefix(['writing-mode'], { + feature: 'css-writing-mode', + browsers: browsers + }); +}); + +// Cross-Fade Function +f(require('caniuse-lite/data/features/css-cross-fade.js'), function (browsers) { + return prefix(['cross-fade'], { + props: ['background', 'background-image', 'border-image', 'mask', 'list-style', 'list-style-image', 'content', 'mask-image'], + feature: 'css-cross-fade', + browsers: browsers + }); +}); + +// Read Only selector +f(require('caniuse-lite/data/features/css-read-only-write.js'), function (browsers) { + return prefix([':read-only', ':read-write'], { + selector: true, + feature: 'css-read-only-write', + browsers: browsers + }); +}); + +// Text Emphasize +f(require('caniuse-lite/data/features/text-emphasis.js'), function (browsers) { + return prefix(['text-emphasis', 'text-emphasis-position', 'text-emphasis-style', 'text-emphasis-color'], { + feature: 'text-emphasis', + browsers: browsers + }); +}); + +// CSS Grid Layout +var grid = require('caniuse-lite/data/features/css-grid.js'); + +f(grid, function (browsers) { + prefix(['display-grid', 'inline-grid'], { + props: ['display'], + feature: 'css-grid', + browsers: browsers + }); + prefix(['grid-template-columns', 'grid-template-rows', 'grid-row-start', 'grid-column-start', 'grid-row-end', 'grid-column-end', 'grid-row', 'grid-column', 'grid-area', 'grid-template', 'grid-template-areas'], { + feature: 'css-grid', + browsers: browsers + }); +}); + +f(grid, { match: /a x/ }, function (browsers) { + return prefix(['grid-column-align', 'grid-row-align'], { + feature: 'css-grid', + browsers: browsers + }); +}); + +// CSS text-spacing +f(require('caniuse-lite/data/features/css-text-spacing.js'), function (browsers) { + return prefix(['text-spacing'], { + feature: 'css-text-spacing', + browsers: browsers + }); +}); + +// :any-link selector +f(require('caniuse-lite/data/features/css-any-link.js'), function (browsers) { + return prefix([':any-link'], { + selector: true, + feature: 'css-any-link', + browsers: browsers + }); +}); + +// unicode-bidi +var bidi = require('caniuse-lite/data/features/css-unicode-bidi.js'); + +f(bidi, function (browsers) { + return prefix(['isolate'], { + props: ['unicode-bidi'], + feature: 'css-unicode-bidi', + browsers: browsers + }); +}); + +f(bidi, { match: /y x|a x #2/ }, function (browsers) { + return prefix(['plaintext'], { + props: ['unicode-bidi'], + feature: 'css-unicode-bidi', + browsers: browsers + }); +}); + +f(bidi, { match: /y x/ }, function (browsers) { + return prefix(['isolate-override'], { + props: ['unicode-bidi'], + feature: 'css-unicode-bidi', + browsers: browsers + }); +}); \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/at-rule.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/at-rule.js new file mode 100644 index 00000000..d77d0124 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/at-rule.js @@ -0,0 +1,70 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Prefixer = require('./prefixer'); + +var AtRule = function (_Prefixer) { + _inherits(AtRule, _Prefixer); + + function AtRule() { + _classCallCheck(this, AtRule); + + return _possibleConstructorReturn(this, _Prefixer.apply(this, arguments)); + } + + /** + * Clone and add prefixes for at-rule + */ + AtRule.prototype.add = function add(rule, prefix) { + var prefixed = prefix + rule.name; + + var already = rule.parent.some(function (i) { + return i.name === prefixed && i.params === rule.params; + }); + if (already) { + return undefined; + } + + var cloned = this.clone(rule, { name: prefixed }); + return rule.parent.insertBefore(rule, cloned); + }; + + /** + * Clone node with prefixes + */ + + + AtRule.prototype.process = function process(node) { + var parent = this.parentPrefix(node); + + for (var _iterator = this.prefixes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var prefix = _ref; + + if (!parent || parent === prefix) { + this.add(node, prefix); + } + } + }; + + return AtRule; +}(Prefixer); + +module.exports = AtRule; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/autoprefixer.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/autoprefixer.js new file mode 100644 index 00000000..3d893c24 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/autoprefixer.js @@ -0,0 +1,126 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var browserslist = require('browserslist'); +var postcss = require('postcss'); + +var Browsers = require('./browsers'); +var Prefixes = require('./prefixes'); + +function isPlainObject(obj) { + return Object.prototype.toString.apply(obj) === '[object Object]'; +} + +var cache = {}; + +function timeCapsule(result, prefixes) { + if (prefixes.browsers.selected.length === 0) { + return; + } + if (prefixes.add.selectors.length > 0) { + return; + } + if (Object.keys(prefixes.add).length > 2) { + return; + } + + /* istanbul ignore next */ + result.warn('Greetings, time traveller. ' + 'We are in the golden age of prefix-less CSS, ' + 'where Autoprefixer is no longer needed for your stylesheet.'); +} + +module.exports = postcss.plugin('autoprefixer', function () { + for (var _len = arguments.length, reqs = Array(_len), _key = 0; _key < _len; _key++) { + reqs[_key] = arguments[_key]; + } + + var options = void 0; + if (reqs.length === 1 && isPlainObject(reqs[0])) { + options = reqs[0]; + reqs = undefined; + } else if (reqs.length === 0 || reqs.length === 1 && !reqs[0]) { + reqs = undefined; + } else if (reqs.length <= 2 && (reqs[0] instanceof Array || !reqs[0])) { + options = reqs[1]; + reqs = reqs[0]; + } else if (_typeof(reqs[reqs.length - 1]) === 'object') { + options = reqs.pop(); + } + + if (!options) { + options = {}; + } + + if (options.browser) { + throw new Error('Change `browser` option to `browsers` in Autoprefixer'); + } else if (options.browserslist) { + throw new Error('Change `browserslist` option to `browsers` in Autoprefixer'); + } + + if (options.browsers) { + reqs = options.browsers; + } + + if (typeof options.grid === 'undefined') { + options.grid = false; + } + + var loadPrefixes = function loadPrefixes(opts) { + var data = module.exports.data; + var browsers = new Browsers(data.browsers, reqs, opts, options.stats); + var key = browsers.selected.join(', ') + JSON.stringify(options); + + if (!cache[key]) { + cache[key] = new Prefixes(data.prefixes, browsers, options); + } + + return cache[key]; + }; + + var plugin = function plugin(css, result) { + var prefixes = loadPrefixes({ + from: css.source && css.source.input.file, + env: options.env + }); + timeCapsule(result, prefixes); + if (options.remove !== false) { + prefixes.processor.remove(css, result); + } + if (options.add !== false) { + prefixes.processor.add(css, result); + } + }; + + plugin.options = options; + + plugin.browsers = reqs; + + plugin.info = function (opts) { + opts = opts || {}; + opts.from = opts.from || process.cwd(); + + return require('./info')(loadPrefixes(opts)); + }; + + return plugin; +}); + +/** + * Autoprefixer data + */ +module.exports.data = { + browsers: require('caniuse-lite').agents, + prefixes: require('../data/prefixes') +}; + +/** + * Autoprefixer default browsers + */ +module.exports.defaults = browserslist.defaults; + +/** + * Inspect with default Autoprefixer + */ +module.exports.info = function () { + return module.exports().info(); +}; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/brackets.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/brackets.js new file mode 100644 index 00000000..7e1ad85c --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/brackets.js @@ -0,0 +1,71 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var last = function last(array) { + return array[array.length - 1]; +}; + +var brackets = { + + /** + * Parse string to nodes tree + */ + parse: function parse(str) { + var current = ['']; + var stack = [current]; + + for (var i = 0; i < str.length; i++) { + var sym = str[i]; + if (sym === '(') { + current = ['']; + last(stack).push(current); + stack.push(current); + continue; + } + + if (sym === ')') { + stack.pop(); + current = last(stack); + current.push(''); + continue; + } + + current[current.length - 1] += sym; + } + + return stack[0]; + }, + + + /** + * Generate output string by nodes tree + */ + stringify: function stringify(ast) { + var result = ''; + for (var _iterator = ast, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var i = _ref; + + if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object') { + result += '(' + brackets.stringify(i) + ')'; + continue; + } + + result += i; + } + return result; + } +}; + +module.exports = brackets; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/browsers.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/browsers.js new file mode 100644 index 00000000..c96a72d5 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/browsers.js @@ -0,0 +1,99 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var browserslist = require('browserslist'); + +var utils = require('./utils'); + +var Browsers = function () { + + /** + * Return all prefixes for default browser data + */ + Browsers.prefixes = function prefixes() { + if (this.prefixesCache) { + return this.prefixesCache; + } + + var data = require('caniuse-lite').agents; + + this.prefixesCache = []; + for (var name in data) { + this.prefixesCache.push('-' + data[name].prefix + '-'); + } + + this.prefixesCache = utils.uniq(this.prefixesCache).sort(function (a, b) { + return b.length - a.length; + }); + + return this.prefixesCache; + }; + + /** + * Check is value contain any possibe prefix + */ + + + Browsers.withPrefix = function withPrefix(value) { + if (!this.prefixesRegexp) { + this.prefixesRegexp = new RegExp(this.prefixes().join('|')); + } + + return this.prefixesRegexp.test(value); + }; + + function Browsers(data, requirements, options, stats) { + _classCallCheck(this, Browsers); + + this.data = data; + this.options = options || {}; + this.stats = stats; + this.selected = this.parse(requirements); + } + + /** + * Return browsers selected by requirements + */ + + + Browsers.prototype.parse = function parse(requirements) { + return browserslist(requirements, { + stats: this.stats, + path: this.options.from, + env: this.options.env + }); + }; + + /** + * Return prefix for selected browser + */ + + + Browsers.prototype.prefix = function prefix(browser) { + var _browser$split = browser.split(' '), + name = _browser$split[0], + version = _browser$split[1]; + + var data = this.data[name]; + + var prefix = data.prefix_exceptions && data.prefix_exceptions[version]; + if (!prefix) { + prefix = data.prefix; + } + return '-' + prefix + '-'; + }; + + /** + * Is browser is selected by requirements + */ + + + Browsers.prototype.isSelected = function isSelected(browser) { + return this.selected.indexOf(browser) !== -1; + }; + + return Browsers; +}(); + +module.exports = Browsers; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/declaration.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/declaration.js new file mode 100644 index 00000000..74dceb98 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/declaration.js @@ -0,0 +1,261 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Prefixer = require('./prefixer'); +var Browsers = require('./browsers'); +var utils = require('./utils'); + +var Declaration = function (_Prefixer) { + _inherits(Declaration, _Prefixer); + + function Declaration() { + _classCallCheck(this, Declaration); + + return _possibleConstructorReturn(this, _Prefixer.apply(this, arguments)); + } + + /** + * Always true, because we already get prefixer by property name + */ + Declaration.prototype.check = function check() /* decl */{ + return true; + }; + + /** + * Return prefixed version of property + */ + + + Declaration.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + prop; + }; + + /** + * Return unprefixed version of property + */ + + + Declaration.prototype.normalize = function normalize(prop) { + return prop; + }; + + /** + * Check `value`, that it contain other prefixes, rather than `prefix` + */ + + + Declaration.prototype.otherPrefixes = function otherPrefixes(value, prefix) { + for (var _iterator = Browsers.prefixes(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var other = _ref; + + if (other === prefix) { + continue; + } + if (value.indexOf(other) !== -1) { + return true; + } + } + return false; + }; + + /** + * Set prefix to declaration + */ + + + Declaration.prototype.set = function set(decl, prefix) { + decl.prop = this.prefixed(decl.prop, prefix); + return decl; + }; + + /** + * Should we use visual cascade for prefixes + */ + + + Declaration.prototype.needCascade = function needCascade(decl) { + if (!decl._autoprefixerCascade) { + decl._autoprefixerCascade = this.all.options.cascade !== false && decl.raw('before').indexOf('\n') !== -1; + } + return decl._autoprefixerCascade; + }; + + /** + * Return maximum length of possible prefixed property + */ + + + Declaration.prototype.maxPrefixed = function maxPrefixed(prefixes, decl) { + if (decl._autoprefixerMax) { + return decl._autoprefixerMax; + } + + var max = 0; + for (var _iterator2 = prefixes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var prefix = _ref2; + + prefix = utils.removeNote(prefix); + if (prefix.length > max) { + max = prefix.length; + } + } + decl._autoprefixerMax = max; + + return decl._autoprefixerMax; + }; + + /** + * Calculate indentation to create visual cascade + */ + + + Declaration.prototype.calcBefore = function calcBefore(prefixes, decl) { + var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + + var max = this.maxPrefixed(prefixes, decl); + var diff = max - utils.removeNote(prefix).length; + + var before = decl.raw('before'); + if (diff > 0) { + before += Array(diff).fill(' ').join(''); + } + + return before; + }; + + /** + * Remove visual cascade + */ + + + Declaration.prototype.restoreBefore = function restoreBefore(decl) { + var lines = decl.raw('before').split('\n'); + var min = lines[lines.length - 1]; + + this.all.group(decl).up(function (prefixed) { + var array = prefixed.raw('before').split('\n'); + var last = array[array.length - 1]; + if (last.length < min.length) { + min = last; + } + }); + + lines[lines.length - 1] = min; + decl.raws.before = lines.join('\n'); + }; + + /** + * Clone and insert new declaration + */ + + + Declaration.prototype.insert = function insert(decl, prefix, prefixes) { + var cloned = this.set(this.clone(decl), prefix); + if (!cloned) return undefined; + + var already = decl.parent.some(function (i) { + return i.prop === cloned.prop && i.value === cloned.value; + }); + if (already) { + return undefined; + } + + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix); + } + return decl.parent.insertBefore(decl, cloned); + }; + + /** + * Did this declaration has this prefix above + */ + + + Declaration.prototype.isAlready = function isAlready(decl, prefixed) { + var already = this.all.group(decl).up(function (i) { + return i.prop === prefixed; + }); + if (!already) { + already = this.all.group(decl).down(function (i) { + return i.prop === prefixed; + }); + } + return already; + }; + + /** + * Clone and add prefixes for declaration + */ + + + Declaration.prototype.add = function add(decl, prefix, prefixes, result) { + var prefixed = this.prefixed(decl.prop, prefix); + if (this.isAlready(decl, prefixed) || this.otherPrefixes(decl.value, prefix)) { + return undefined; + } + return this.insert(decl, prefix, prefixes, result); + }; + + /** + * Add spaces for visual cascade + */ + + + Declaration.prototype.process = function process(decl, result) { + if (!this.needCascade(decl)) { + _Prefixer.prototype.process.call(this, decl, result); + return; + } + + var prefixes = _Prefixer.prototype.process.call(this, decl, result); + + if (!prefixes || !prefixes.length) { + return; + } + + this.restoreBefore(decl); + decl.raws.before = this.calcBefore(prefixes, decl); + }; + + /** + * Return list of prefixed properties to clean old prefixes + */ + + + Declaration.prototype.old = function old(prop, prefix) { + return [this.prefixed(prop, prefix)]; + }; + + return Declaration; +}(Prefixer); + +module.exports = Declaration; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-content.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-content.js new file mode 100644 index 00000000..482f5c38 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-content.js @@ -0,0 +1,86 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var AlignContent = function (_Declaration) { + _inherits(AlignContent, _Declaration); + + function AlignContent() { + _classCallCheck(this, AlignContent); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2012 spec + */ + AlignContent.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2012) { + return prefix + 'flex-line-pack'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + AlignContent.prototype.normalize = function normalize() { + return 'align-content'; + }; + + /** + * Change value for 2012 spec and ignore prefix for 2009 + */ + + + AlignContent.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2012) { + decl.value = AlignContent.oldValues[decl.value] || decl.value; + return _Declaration.prototype.set.call(this, decl, prefix); + } else if (spec === 'final') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return AlignContent; +}(Declaration); + +Object.defineProperty(AlignContent, 'names', { + enumerable: true, + writable: true, + value: ['align-content', 'flex-line-pack'] +}); +Object.defineProperty(AlignContent, 'oldValues', { + enumerable: true, + writable: true, + value: { + 'flex-end': 'end', + 'flex-start': 'start', + 'space-between': 'justify', + 'space-around': 'distribute' + } +}); + + +module.exports = AlignContent; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-items.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-items.js new file mode 100644 index 00000000..a545cd05 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-items.js @@ -0,0 +1,83 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var AlignItems = function (_Declaration) { + _inherits(AlignItems, _Declaration); + + function AlignItems() { + _classCallCheck(this, AlignItems); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2009 and 2012 specs + */ + AlignItems.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2009) { + return prefix + 'box-align'; + } else if (spec === 2012) { + return prefix + 'flex-align'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + AlignItems.prototype.normalize = function normalize() { + return 'align-items'; + }; + + /** + * Change value for 2009 and 2012 specs + */ + + + AlignItems.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2009 || spec === 2012) { + decl.value = AlignItems.oldValues[decl.value] || decl.value; + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return AlignItems; +}(Declaration); + +Object.defineProperty(AlignItems, 'names', { + enumerable: true, + writable: true, + value: ['align-items', 'flex-align', 'box-align'] +}); +Object.defineProperty(AlignItems, 'oldValues', { + enumerable: true, + writable: true, + value: { + 'flex-end': 'end', + 'flex-start': 'start' + } +}); + + +module.exports = AlignItems; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-self.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-self.js new file mode 100644 index 00000000..b38cb4a7 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/align-self.js @@ -0,0 +1,84 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var AlignSelf = function (_Declaration) { + _inherits(AlignSelf, _Declaration); + + function AlignSelf() { + _classCallCheck(this, AlignSelf); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2012 specs + */ + AlignSelf.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2012) { + return prefix + 'flex-item-align'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + AlignSelf.prototype.normalize = function normalize() { + return 'align-self'; + }; + + /** + * Change value for 2012 spec and ignore prefix for 2009 + */ + + + AlignSelf.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2012) { + decl.value = AlignSelf.oldValues[decl.value] || decl.value; + return _Declaration.prototype.set.call(this, decl, prefix); + } else if (spec === 'final') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return AlignSelf; +}(Declaration); + +Object.defineProperty(AlignSelf, 'names', { + enumerable: true, + writable: true, + value: ['align-self', 'flex-item-align'] +}); +Object.defineProperty(AlignSelf, 'oldValues', { + enumerable: true, + writable: true, + value: { + 'flex-end': 'end', + 'flex-start': 'start' + } +}); + + +module.exports = AlignSelf; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/animation.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/animation.js new file mode 100644 index 00000000..c226aaf9 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/animation.js @@ -0,0 +1,42 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var Animation = function (_Declaration) { + _inherits(Animation, _Declaration); + + function Animation() { + _classCallCheck(this, Animation); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Don’t add prefixes for modern values. + */ + Animation.prototype.check = function check(decl) { + return !decl.value.split(/\s+/).some(function (i) { + var lower = i.toLowerCase(); + return lower === 'reverse' || lower === 'alternate-reverse'; + }); + }; + + return Animation; +}(Declaration); + +Object.defineProperty(Animation, 'names', { + enumerable: true, + writable: true, + value: ['animation', 'animation-direction'] +}); + + +module.exports = Animation; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/appearance.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/appearance.js new file mode 100644 index 00000000..c965c749 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/appearance.js @@ -0,0 +1,44 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); +var utils = require('../utils'); + +var Appearance = function (_Declaration) { + _inherits(Appearance, _Declaration); + + function Appearance(name, prefixes, all) { + _classCallCheck(this, Appearance); + + var _this = _possibleConstructorReturn(this, _Declaration.call(this, name, prefixes, all)); + + if (_this.prefixes) { + _this.prefixes = utils.uniq(_this.prefixes.map(function (i) { + if (i === '-ms-') { + return '-webkit-'; + } else { + return i; + } + })); + } + return _this; + } + + return Appearance; +}(Declaration); + +Object.defineProperty(Appearance, 'names', { + enumerable: true, + writable: true, + value: ['appearance'] +}); + + +module.exports = Appearance; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/background-size.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/background-size.js new file mode 100644 index 00000000..56253c3c --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/background-size.js @@ -0,0 +1,43 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BackgroundSize = function (_Declaration) { + _inherits(BackgroundSize, _Declaration); + + function BackgroundSize() { + _classCallCheck(this, BackgroundSize); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Duplication parameter for -webkit- browsers + */ + BackgroundSize.prototype.set = function set(decl, prefix) { + var value = decl.value.toLowerCase(); + if (prefix === '-webkit-' && value.indexOf(' ') === -1 && value !== 'contain' && value !== 'cover') { + decl.value = decl.value + ' ' + decl.value; + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return BackgroundSize; +}(Declaration); + +Object.defineProperty(BackgroundSize, 'names', { + enumerable: true, + writable: true, + value: ['background-size'] +}); + + +module.exports = BackgroundSize; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/block-logical.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/block-logical.js new file mode 100644 index 00000000..afbe7db3 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/block-logical.js @@ -0,0 +1,52 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BlockLogical = function (_Declaration) { + _inherits(BlockLogical, _Declaration); + + function BlockLogical() { + _classCallCheck(this, BlockLogical); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Use old syntax for -moz- and -webkit- + */ + BlockLogical.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + (prop.indexOf('-start') !== -1 ? prop.replace('-block-start', '-before') : prop.replace('-block-end', '-after')); + }; + + /** + * Return property name by spec + */ + + + BlockLogical.prototype.normalize = function normalize(prop) { + if (prop.indexOf('-before') !== -1) { + return prop.replace('-before', '-block-start'); + } else { + return prop.replace('-after', '-block-end'); + } + }; + + return BlockLogical; +}(Declaration); + +Object.defineProperty(BlockLogical, 'names', { + enumerable: true, + writable: true, + value: ['border-block-start', 'border-block-end', 'margin-block-start', 'margin-block-end', 'padding-block-start', 'padding-block-end', 'border-before', 'border-after', 'margin-before', 'margin-after', 'padding-before', 'padding-after'] +}); + + +module.exports = BlockLogical; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/border-image.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/border-image.js new file mode 100644 index 00000000..a48e1135 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/border-image.js @@ -0,0 +1,40 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BorderImage = function (_Declaration) { + _inherits(BorderImage, _Declaration); + + function BorderImage() { + _classCallCheck(this, BorderImage); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Remove fill parameter for prefixed declarations + */ + BorderImage.prototype.set = function set(decl, prefix) { + decl.value = decl.value.replace(/\s+fill(\s)/, '$1'); + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return BorderImage; +}(Declaration); + +Object.defineProperty(BorderImage, 'names', { + enumerable: true, + writable: true, + value: ['border-image'] +}); + + +module.exports = BorderImage; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/border-radius.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/border-radius.js new file mode 100644 index 00000000..c553b8ce --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/border-radius.js @@ -0,0 +1,79 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BorderRadius = function (_Declaration) { + _inherits(BorderRadius, _Declaration); + + function BorderRadius() { + _classCallCheck(this, BorderRadius); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change syntax, when add Mozilla prefix + */ + BorderRadius.prototype.prefixed = function prefixed(prop, prefix) { + if (prefix === '-moz-') { + return prefix + (BorderRadius.toMozilla[prop] || prop); + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return unprefixed version of property + */ + + + BorderRadius.prototype.normalize = function normalize(prop) { + return BorderRadius.toNormal[prop] || prop; + }; + + return BorderRadius; +}(Declaration); + +Object.defineProperty(BorderRadius, 'names', { + enumerable: true, + writable: true, + value: ['border-radius'] +}); +Object.defineProperty(BorderRadius, 'toMozilla', { + enumerable: true, + writable: true, + value: {} +}); +Object.defineProperty(BorderRadius, 'toNormal', { + enumerable: true, + writable: true, + value: {} +}); +var _arr = ['top', 'bottom']; + + +for (var _i = 0; _i < _arr.length; _i++) { + var ver = _arr[_i];var _arr2 = ['left', 'right']; + + for (var _i2 = 0; _i2 < _arr2.length; _i2++) { + var hor = _arr2[_i2]; + var normal = 'border-' + ver + '-' + hor + '-radius'; + var mozilla = 'border-radius-' + ver + hor; + + BorderRadius.names.push(normal); + BorderRadius.names.push(mozilla); + + BorderRadius.toMozilla[normal] = mozilla; + BorderRadius.toNormal[mozilla] = normal; + } +} + +module.exports = BorderRadius; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/break-props.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/break-props.js new file mode 100644 index 00000000..fe42ca6a --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/break-props.js @@ -0,0 +1,87 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BreakProps = function (_Declaration) { + _inherits(BreakProps, _Declaration); + + function BreakProps() { + _classCallCheck(this, BreakProps); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change name for -webkit- and -moz- prefix + */ + BreakProps.prototype.prefixed = function prefixed(prop, prefix) { + if (prefix === '-moz-') { + return 'page-' + prop; + } else { + return prefix + 'column-' + prop; + } + }; + + /** + * Return property name by final spec + */ + + + BreakProps.prototype.normalize = function normalize(prop) { + if (prop.indexOf('inside') !== -1) { + return 'break-inside'; + } else if (prop.indexOf('before') !== -1) { + return 'break-before'; + } else { + return 'break-after'; + } + }; + + /** + * Change prefixed value for avoid-column and avoid-page + */ + + + BreakProps.prototype.set = function set(decl, prefix) { + if (decl.prop === 'break-inside' && decl.value === 'avoid-column' || decl.value === 'avoid-page') { + decl.value = 'avoid'; + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + /** + * Don’t prefix some values + */ + + + BreakProps.prototype.insert = function insert(decl, prefix, prefixes) { + if (decl.prop !== 'break-inside') { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } else if (decl.value === 'avoid-region') { + return undefined; + } else if (decl.value === 'avoid-page' && prefix === '-webkit-') { + return undefined; + } else { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } + }; + + return BreakProps; +}(Declaration); + +Object.defineProperty(BreakProps, 'names', { + enumerable: true, + writable: true, + value: ['break-inside', 'page-break-inside', 'column-break-inside', 'break-before', 'page-break-before', 'column-break-before', 'break-after', 'page-break-after', 'column-break-after'] +}); + + +module.exports = BreakProps; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/cross-fade.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/cross-fade.js new file mode 100644 index 00000000..764db3c5 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/cross-fade.js @@ -0,0 +1,58 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Value = require('../value'); +var list = require('postcss').list; + +var CrossFade = function (_Value) { + _inherits(CrossFade, _Value); + + function CrossFade() { + _classCallCheck(this, CrossFade); + + return _possibleConstructorReturn(this, _Value.apply(this, arguments)); + } + + CrossFade.prototype.replace = function replace(string, prefix) { + var _this2 = this; + + return list.space(string).map(function (value) { + if (value.slice(0, +_this2.name.length + 1) !== _this2.name + '(') { + return value; + } + + var close = value.lastIndexOf(')'); + var after = value.slice(close + 1); + var args = value.slice(_this2.name.length + 1, close); + + if (prefix === '-webkit-') { + var match = args.match(/\d*.?\d+%?/); + if (match) { + args = args.slice(match[0].length).trim(); + args += ', ' + match[0]; + } else { + args += ', 0.5'; + } + } + return prefix + _this2.name + '(' + args + ')' + after; + }).join(' '); + }; + + return CrossFade; +}(Value); + +Object.defineProperty(CrossFade, 'names', { + enumerable: true, + writable: true, + value: ['cross-fade'] +}); + + +module.exports = CrossFade; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/display-flex.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/display-flex.js new file mode 100644 index 00000000..2937a6b2 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/display-flex.js @@ -0,0 +1,102 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var OldValue = require('../old-value'); +var Value = require('../value'); + +var DisplayFlex = function (_Value) { + _inherits(DisplayFlex, _Value); + + function DisplayFlex(name, prefixes) { + _classCallCheck(this, DisplayFlex); + + var _this = _possibleConstructorReturn(this, _Value.call(this, name, prefixes)); + + if (name === 'display-flex') { + _this.name = 'flex'; + } + return _this; + } + + /** + * Faster check for flex value + */ + + + DisplayFlex.prototype.check = function check(decl) { + return decl.prop === 'display' && decl.value === this.name; + }; + + /** + * Return value by spec + */ + + + DisplayFlex.prototype.prefixed = function prefixed(prefix) { + var spec = void 0, + value = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + + if (spec === 2009) { + if (this.name === 'flex') { + value = 'box'; + } else { + value = 'inline-box'; + } + } else if (spec === 2012) { + if (this.name === 'flex') { + value = 'flexbox'; + } else { + value = 'inline-flexbox'; + } + } else if (spec === 'final') { + value = this.name; + } + + return prefix + value; + }; + + /** + * Add prefix to value depend on flebox spec version + */ + + + DisplayFlex.prototype.replace = function replace(string, prefix) { + return this.prefixed(prefix); + }; + + /** + * Change value for old specs + */ + + + DisplayFlex.prototype.old = function old(prefix) { + var prefixed = this.prefixed(prefix); + if (!prefixed) return undefined; + return new OldValue(this.name, prefixed); + }; + + return DisplayFlex; +}(Value); + +Object.defineProperty(DisplayFlex, 'names', { + enumerable: true, + writable: true, + value: ['display-flex', 'inline-flex'] +}); + + +module.exports = DisplayFlex; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/display-grid.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/display-grid.js new file mode 100644 index 00000000..1bd61b80 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/display-grid.js @@ -0,0 +1,46 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Value = require('../value'); + +var DisplayGrid = function (_Value) { + _inherits(DisplayGrid, _Value); + + function DisplayGrid(name, prefixes) { + _classCallCheck(this, DisplayGrid); + + var _this = _possibleConstructorReturn(this, _Value.call(this, name, prefixes)); + + if (name === 'display-grid') { + _this.name = 'grid'; + } + return _this; + } + + /** + * Faster check for flex value + */ + + + DisplayGrid.prototype.check = function check(decl) { + return decl.prop === 'display' && decl.value === this.name; + }; + + return DisplayGrid; +}(Value); + +Object.defineProperty(DisplayGrid, 'names', { + enumerable: true, + writable: true, + value: ['display-grid', 'inline-grid'] +}); + + +module.exports = DisplayGrid; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/filter-value.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/filter-value.js new file mode 100644 index 00000000..41ba2721 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/filter-value.js @@ -0,0 +1,37 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Value = require('../value'); + +var FilterValue = function (_Value) { + _inherits(FilterValue, _Value); + + function FilterValue(name, prefixes) { + _classCallCheck(this, FilterValue); + + var _this = _possibleConstructorReturn(this, _Value.call(this, name, prefixes)); + + if (name === 'filter-function') { + _this.name = 'filter'; + } + return _this; + } + + return FilterValue; +}(Value); + +Object.defineProperty(FilterValue, 'names', { + enumerable: true, + writable: true, + value: ['filter', 'filter-function'] +}); + + +module.exports = FilterValue; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/filter.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/filter.js new file mode 100644 index 00000000..aeaeac36 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/filter.js @@ -0,0 +1,40 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var Filter = function (_Declaration) { + _inherits(Filter, _Declaration); + + function Filter() { + _classCallCheck(this, Filter); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Check is it Internet Explorer filter + */ + Filter.prototype.check = function check(decl) { + var v = decl.value; + return v.toLowerCase().indexOf('alpha(') === -1 && v.indexOf('DXImageTransform.Microsoft') === -1 && v.indexOf('data:image/svg+xml') === -1; + }; + + return Filter; +}(Declaration); + +Object.defineProperty(Filter, 'names', { + enumerable: true, + writable: true, + value: ['filter'] +}); + + +module.exports = Filter; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-basis.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-basis.js new file mode 100644 index 00000000..62634844 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-basis.js @@ -0,0 +1,79 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var FlexBasis = function (_Declaration) { + _inherits(FlexBasis, _Declaration); + + function FlexBasis() { + _classCallCheck(this, FlexBasis); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Return property name by final spec + */ + FlexBasis.prototype.normalize = function normalize() { + return 'flex-basis'; + }; + + /** + * Return flex property for 2012 spec + */ + + + FlexBasis.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2012) { + return prefix + 'flex-preferred-size'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Ignore 2009 spec and use flex property for 2012 + */ + + + FlexBasis.prototype.set = function set(decl, prefix) { + var spec = void 0; + + var _flexSpec2 = flexSpec(prefix); + + spec = _flexSpec2[0]; + prefix = _flexSpec2[1]; + + if (spec === 2012 || spec === 'final') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return FlexBasis; +}(Declaration); + +Object.defineProperty(FlexBasis, 'names', { + enumerable: true, + writable: true, + value: ['flex-basis', 'flex-preferred-size'] +}); + + +module.exports = FlexBasis; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-direction.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-direction.js new file mode 100644 index 00000000..7ca23e31 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-direction.js @@ -0,0 +1,112 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var FlexDirection = function (_Declaration) { + _inherits(FlexDirection, _Declaration); + + function FlexDirection() { + _classCallCheck(this, FlexDirection); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Return property name by final spec + */ + FlexDirection.prototype.normalize = function normalize() { + return 'flex-direction'; + }; + + /** + * Use two properties for 2009 spec + */ + + + FlexDirection.prototype.insert = function insert(decl, prefix, prefixes) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec !== 2009) { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } else { + var already = decl.parent.some(function (i) { + return i.prop === prefix + 'box-orient' || i.prop === prefix + 'box-direction'; + }); + if (already) { + return undefined; + } + + var v = decl.value; + var orient = void 0, + dir = void 0; + if (v === 'inherit' || v === 'initial' || v === 'unset') { + orient = v; + dir = v; + } else { + orient = v.indexOf('row') !== -1 ? 'horizontal' : 'vertical'; + dir = v.indexOf('reverse') !== -1 ? 'reverse' : 'normal'; + } + + var cloned = this.clone(decl); + cloned.prop = prefix + 'box-orient'; + cloned.value = orient; + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix); + } + decl.parent.insertBefore(decl, cloned); + + cloned = this.clone(decl); + cloned.prop = prefix + 'box-direction'; + cloned.value = dir; + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix); + } + return decl.parent.insertBefore(decl, cloned); + } + }; + + /** + * Clean two properties for 2009 spec + */ + + + FlexDirection.prototype.old = function old(prop, prefix) { + var spec = void 0; + + var _flexSpec2 = flexSpec(prefix); + + spec = _flexSpec2[0]; + prefix = _flexSpec2[1]; + + if (spec === 2009) { + return [prefix + 'box-orient', prefix + 'box-direction']; + } else { + return _Declaration.prototype.old.call(this, prop, prefix); + } + }; + + return FlexDirection; +}(Declaration); + +Object.defineProperty(FlexDirection, 'names', { + enumerable: true, + writable: true, + value: ['flex-direction', 'box-direction', 'box-orient'] +}); + + +module.exports = FlexDirection; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-flow.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-flow.js new file mode 100644 index 00000000..74c7cef9 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-flow.js @@ -0,0 +1,83 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var FlexFlow = function (_Declaration) { + _inherits(FlexFlow, _Declaration); + + function FlexFlow() { + _classCallCheck(this, FlexFlow); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Use two properties for 2009 spec + */ + FlexFlow.prototype.insert = function insert(decl, prefix, prefixes) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec !== 2009) { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } else { + var values = decl.value.split(/\s+/).filter(function (i) { + return i !== 'wrap' && i !== 'nowrap' && 'wrap-reverse'; + }); + if (values.length === 0) { + return undefined; + } + + var already = decl.parent.some(function (i) { + return i.prop === prefix + 'box-orient' || i.prop === prefix + 'box-direction'; + }); + if (already) { + return undefined; + } + + var value = values[0]; + var orient = value.indexOf('row') !== -1 ? 'horizontal' : 'vertical'; + var dir = value.indexOf('reverse') !== -1 ? 'reverse' : 'normal'; + + var cloned = this.clone(decl); + cloned.prop = prefix + 'box-orient'; + cloned.value = orient; + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix); + } + decl.parent.insertBefore(decl, cloned); + + cloned = this.clone(decl); + cloned.prop = prefix + 'box-direction'; + cloned.value = dir; + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix); + } + return decl.parent.insertBefore(decl, cloned); + } + }; + + return FlexFlow; +}(Declaration); + +Object.defineProperty(FlexFlow, 'names', { + enumerable: true, + writable: true, + value: ['flex-flow', 'box-direction', 'box-orient'] +}); + + +module.exports = FlexFlow; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-grow.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-grow.js new file mode 100644 index 00000000..2efc5b91 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-grow.js @@ -0,0 +1,62 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var Flex = function (_Declaration) { + _inherits(Flex, _Declaration); + + function Flex() { + _classCallCheck(this, Flex); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Return property name by final spec + */ + Flex.prototype.normalize = function normalize() { + return 'flex'; + }; + + /** + * Return flex property for 2009 and 2012 specs + */ + + + Flex.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2009) { + return prefix + 'box-flex'; + } else if (spec === 2012) { + return prefix + 'flex-positive'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + return Flex; +}(Declaration); + +Object.defineProperty(Flex, 'names', { + enumerable: true, + writable: true, + value: ['flex-grow', 'flex-positive'] +}); + + +module.exports = Flex; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-shrink.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-shrink.js new file mode 100644 index 00000000..05ab9658 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-shrink.js @@ -0,0 +1,79 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var FlexShrink = function (_Declaration) { + _inherits(FlexShrink, _Declaration); + + function FlexShrink() { + _classCallCheck(this, FlexShrink); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Return property name by final spec + */ + FlexShrink.prototype.normalize = function normalize() { + return 'flex-shrink'; + }; + + /** + * Return flex property for 2012 spec + */ + + + FlexShrink.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2012) { + return prefix + 'flex-negative'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Ignore 2009 spec and use flex property for 2012 + */ + + + FlexShrink.prototype.set = function set(decl, prefix) { + var spec = void 0; + + var _flexSpec2 = flexSpec(prefix); + + spec = _flexSpec2[0]; + prefix = _flexSpec2[1]; + + if (spec === 2012 || spec === 'final') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return FlexShrink; +}(Declaration); + +Object.defineProperty(FlexShrink, 'names', { + enumerable: true, + writable: true, + value: ['flex-shrink', 'flex-negative'] +}); + + +module.exports = FlexShrink; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-spec.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-spec.js new file mode 100644 index 00000000..06ebd104 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-spec.js @@ -0,0 +1,21 @@ +'use strict'; + +/** + * Return flexbox spec versions by prefix + */ +module.exports = function (prefix) { + var spec = void 0; + if (prefix === '-webkit- 2009' || prefix === '-moz-') { + spec = 2009; + } else if (prefix === '-ms-') { + spec = 2012; + } else if (prefix === '-webkit-') { + spec = 'final'; + } + + if (prefix === '-webkit- 2009') { + prefix = '-webkit-'; + } + + return [spec, prefix]; +}; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-wrap.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-wrap.js new file mode 100644 index 00000000..bc514460 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex-wrap.js @@ -0,0 +1,44 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var FlexWrap = function (_Declaration) { + _inherits(FlexWrap, _Declaration); + + function FlexWrap() { + _classCallCheck(this, FlexWrap); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Don't add prefix for 2009 spec + */ + FlexWrap.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec !== 2009) { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return FlexWrap; +}(Declaration); + +Object.defineProperty(FlexWrap, 'names', { + enumerable: true, + writable: true, + value: ['flex-wrap'] +}); + + +module.exports = FlexWrap; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex.js new file mode 100644 index 00000000..4ebad1b6 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/flex.js @@ -0,0 +1,91 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var list = require('postcss').list; + +var Flex = function (_Declaration) { + _inherits(Flex, _Declaration); + + function Flex() { + _classCallCheck(this, Flex); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2009 spec + */ + Flex.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2009) { + return prefix + 'box-flex'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + Flex.prototype.normalize = function normalize() { + return 'flex'; + }; + + /** + * Spec 2009 supports only first argument + * Spec 2012 disallows unitless basis + */ + + + Flex.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2009) { + decl.value = list.space(decl.value)[0]; + decl.value = Flex.oldValues[decl.value] || decl.value; + return _Declaration.prototype.set.call(this, decl, prefix); + } else if (spec === 2012) { + var components = list.space(decl.value); + if (components.length === 3 && components[2] === '0') { + decl.value = components.slice(0, 2).concat('0px').join(' '); + } + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return Flex; +}(Declaration); + +Object.defineProperty(Flex, 'names', { + enumerable: true, + writable: true, + value: ['flex', 'box-flex'] +}); +Object.defineProperty(Flex, 'oldValues', { + enumerable: true, + writable: true, + value: { + auto: '1', + none: '0' + } +}); + + +module.exports = Flex; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/fullscreen.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/fullscreen.js new file mode 100644 index 00000000..805f81bf --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/fullscreen.js @@ -0,0 +1,45 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Selector = require('../selector'); + +var Fullscreen = function (_Selector) { + _inherits(Fullscreen, _Selector); + + function Fullscreen() { + _classCallCheck(this, Fullscreen); + + return _possibleConstructorReturn(this, _Selector.apply(this, arguments)); + } + + /** + * Return different selectors depend on prefix + */ + Fullscreen.prototype.prefixed = function prefixed(prefix) { + if (prefix === '-webkit-') { + return ':-webkit-full-screen'; + } else if (prefix === '-moz-') { + return ':-moz-full-screen'; + } else { + return ':' + prefix + 'fullscreen'; + } + }; + + return Fullscreen; +}(Selector); + +Object.defineProperty(Fullscreen, 'names', { + enumerable: true, + writable: true, + value: [':fullscreen'] +}); + + +module.exports = Fullscreen; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/gradient.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/gradient.js new file mode 100644 index 00000000..b1aa96a0 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/gradient.js @@ -0,0 +1,525 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var OldValue = require('../old-value'); +var Value = require('../value'); +var utils = require('../utils'); + +var parser = require('postcss-value-parser'); +var range = require('normalize-range'); + +var isDirection = /top|left|right|bottom/gi; + +var Gradient = function (_Value) { + _inherits(Gradient, _Value); + + function Gradient() { + var _temp, _this, _ret; + + _classCallCheck(this, Gradient); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Value.call.apply(_Value, [this].concat(args))), _this), Object.defineProperty(_this, 'directions', { + enumerable: true, + writable: true, + value: { + top: 'bottom', + left: 'right', + bottom: 'top', + right: 'left' + } + }), Object.defineProperty(_this, 'oldDirections', { + enumerable: true, + writable: true, + value: { + 'top': 'left bottom, left top', + 'left': 'right top, left top', + 'bottom': 'left top, left bottom', + 'right': 'left top, right top', + + 'top right': 'left bottom, right top', + 'top left': 'right bottom, left top', + 'right top': 'left bottom, right top', + 'right bottom': 'left top, right bottom', + 'bottom right': 'left top, right bottom', + 'bottom left': 'right top, left bottom', + 'left top': 'right bottom, left top', + 'left bottom': 'right top, left bottom' + } + }), _temp), _possibleConstructorReturn(_this, _ret); + } + + // Direction to replace + + + // Direction to replace + + + /** + * Change degrees for webkit prefix + */ + Gradient.prototype.replace = function replace(string, prefix) { + var ast = parser(string); + for (var _iterator = ast.nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var node = _ref; + + if (node.type === 'function' && node.value === this.name) { + node.nodes = this.newDirection(node.nodes); + node.nodes = this.normalize(node.nodes); + if (prefix === '-webkit- old') { + var changes = this.oldWebkit(node); + if (!changes) { + return false; + } + } else { + node.nodes = this.convertDirection(node.nodes); + node.value = prefix + node.value; + } + } + } + return ast.toString(); + }; + + /** + * Replace first token + */ + + + Gradient.prototype.replaceFirst = function replaceFirst(params) { + for (var _len2 = arguments.length, words = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + words[_key2 - 1] = arguments[_key2]; + } + + var prefix = words.map(function (i) { + if (i === ' ') { + return { type: 'space', value: i }; + } else { + return { type: 'word', value: i }; + } + }); + return prefix.concat(params.slice(1)); + }; + + /** + * Convert angle unit to deg + */ + + + Gradient.prototype.normalizeUnit = function normalizeUnit(str, full) { + var num = parseFloat(str); + var deg = num / full * 360; + return deg + 'deg'; + }; + + /** + * Normalize angle + */ + + + Gradient.prototype.normalize = function normalize(nodes) { + if (!nodes[0]) return nodes; + + if (/-?\d+(.\d+)?grad/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 400); + } else if (/-?\d+(.\d+)?rad/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 2 * Math.PI); + } else if (/-?\d+(.\d+)?turn/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 1); + } else if (nodes[0].value.indexOf('deg') !== -1) { + var num = parseFloat(nodes[0].value); + num = range.wrap(0, 360, num); + nodes[0].value = num + 'deg'; + } + + if (nodes[0].value === '0deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'top'); + } else if (nodes[0].value === '90deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'right'); + } else if (nodes[0].value === '180deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'bottom'); + } else if (nodes[0].value === '270deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'left'); + } + + return nodes; + }; + + /** + * Replace old direction to new + */ + + + Gradient.prototype.newDirection = function newDirection(params) { + if (params[0].value === 'to') { + return params; + } + isDirection.lastIndex = 0; // reset search index of global regexp + if (!isDirection.test(params[0].value)) { + return params; + } + + params.unshift({ + type: 'word', + value: 'to' + }, { + type: 'space', + value: ' ' + }); + + for (var i = 2; i < params.length; i++) { + if (params[i].type === 'div') { + break; + } + if (params[i].type === 'word') { + params[i].value = this.revertDirection(params[i].value); + } + } + + return params; + }; + + /** + * Change new direction to old + */ + + + Gradient.prototype.convertDirection = function convertDirection(params) { + if (params.length > 0) { + if (params[0].value === 'to') { + this.fixDirection(params); + } else if (params[0].value.indexOf('deg') !== -1) { + this.fixAngle(params); + } else if (params[2] && params[2].value === 'at') { + this.fixRadial(params); + } + } + return params; + }; + + /** + * Replace `to top left` to `bottom right` + */ + + + Gradient.prototype.fixDirection = function fixDirection(params) { + params.splice(0, 2); + + for (var _iterator2 = params, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var param = _ref2; + + if (param.type === 'div') { + break; + } + if (param.type === 'word') { + param.value = this.revertDirection(param.value); + } + } + }; + + /** + * Add 90 degrees + */ + + + Gradient.prototype.fixAngle = function fixAngle(params) { + var first = params[0].value; + first = parseFloat(first); + first = Math.abs(450 - first) % 360; + first = this.roundFloat(first, 3); + params[0].value = first + 'deg'; + }; + + /** + * Fix radial direction syntax + */ + + + Gradient.prototype.fixRadial = function fixRadial(params) { + var first = params[0]; + var second = []; + var i = void 0; + + var div = void 0; + for (i = 4; i < params.length; i++) { + if (params[i].type === 'div') { + div = params[i]; + break; + } else { + second.push(params[i]); + } + } + + params.splice.apply(params, [0, i].concat(second, [div, first])); + }; + + Gradient.prototype.revertDirection = function revertDirection(word) { + return this.directions[word.toLowerCase()] || word; + }; + + /** + * Round float and save digits under dot + */ + + + Gradient.prototype.roundFloat = function roundFloat(float, digits) { + return parseFloat(float.toFixed(digits)); + }; + + /** + * Convert to old webkit syntax + */ + + + Gradient.prototype.oldWebkit = function oldWebkit(node) { + var nodes = node.nodes; + + var string = parser.stringify(node.nodes); + + if (this.name !== 'linear-gradient') { + return false; + } + if (nodes[0] && nodes[0].value.indexOf('deg') !== -1) { + return false; + } + if (string.indexOf('px') !== -1 || string.indexOf('-corner') !== -1 || string.indexOf('-side') !== -1) { + return false; + } + + var params = [[]]; + for (var _iterator3 = nodes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var i = _ref3; + + params[params.length - 1].push(i); + if (i.type === 'div' && i.value === ',') { + params.push([]); + } + } + + this.oldDirection(params); + this.colorStops(params); + + node.nodes = []; + for (var _iterator4 = params, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var param = _ref4; + + node.nodes = node.nodes.concat(param); + } + + node.nodes.unshift({ type: 'word', value: 'linear' }, this.cloneDiv(node.nodes)); + node.value = '-webkit-gradient'; + + return true; + }; + + /** + * Change direction syntax to old webkit + */ + + + Gradient.prototype.oldDirection = function oldDirection(params) { + var div = this.cloneDiv(params[0]); + + if (params[0][0].value !== 'to') { + return params.unshift([{ type: 'word', value: this.oldDirections.bottom }, div]); + } else { + var _words = []; + for (var _iterator5 = params[0].slice(2), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref5; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref5 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref5 = _i5.value; + } + + var node = _ref5; + + if (node.type === 'word') { + _words.push(node.value.toLowerCase()); + } + } + + _words = _words.join(' '); + var old = this.oldDirections[_words] || _words; + + params[0] = [{ type: 'word', value: old }, div]; + return params[0]; + } + }; + + /** + * Get div token from exists parameters + */ + + + Gradient.prototype.cloneDiv = function cloneDiv(params) { + for (var _iterator6 = params, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref6; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref6 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref6 = _i6.value; + } + + var i = _ref6; + + if (i.type === 'div' && i.value === ',') { + return i; + } + } + return { type: 'div', value: ',', after: ' ' }; + }; + + /** + * Change colors syntax to old webkit + */ + + + Gradient.prototype.colorStops = function colorStops(params) { + var result = []; + for (var i = 0; i < params.length; i++) { + var pos = void 0; + var param = params[i]; + var item = void 0; + if (i === 0) { + continue; + } + + var color = parser.stringify(param[0]); + if (param[1] && param[1].type === 'word') { + pos = param[1].value; + } else if (param[2] && param[2].type === 'word') { + pos = param[2].value; + } + + var stop = void 0; + if (i === 1 && (!pos || pos === '0%')) { + stop = 'from(' + color + ')'; + } else if (i === params.length - 1 && (!pos || pos === '100%')) { + stop = 'to(' + color + ')'; + } else if (pos) { + stop = 'color-stop(' + pos + ', ' + color + ')'; + } else { + stop = 'color-stop(' + color + ')'; + } + + var div = param[param.length - 1]; + params[i] = [{ type: 'word', value: stop }]; + if (div.type === 'div' && div.value === ',') { + item = params[i].push(div); + } + result.push(item); + } + return result; + }; + + /** + * Remove old WebKit gradient too + */ + + + Gradient.prototype.old = function old(prefix) { + if (prefix === '-webkit-') { + var type = this.name === 'linear-gradient' ? 'linear' : 'radial'; + var string = '-gradient'; + var regexp = utils.regexp('-webkit-(' + type + '-gradient|gradient\\(\\s*' + type + ')', false); + + return new OldValue(this.name, prefix + this.name, string, regexp); + } else { + return _Value.prototype.old.call(this, prefix); + } + }; + + /** + * Do not add non-webkit prefixes for list-style and object + */ + + + Gradient.prototype.add = function add(decl, prefix) { + var p = decl.prop; + if (p.indexOf('mask') !== -1) { + if (prefix === '-webkit-' || prefix === '-webkit- old') { + return _Value.prototype.add.call(this, decl, prefix); + } + } else if (p === 'list-style' || p === 'list-style-image' || p === 'content') { + if (prefix === '-webkit-' || prefix === '-webkit- old') { + return _Value.prototype.add.call(this, decl, prefix); + } + } else { + return _Value.prototype.add.call(this, decl, prefix); + } + return undefined; + }; + + return Gradient; +}(Value); + +Object.defineProperty(Gradient, 'names', { + enumerable: true, + writable: true, + value: ['linear-gradient', 'repeating-linear-gradient', 'radial-gradient', 'repeating-radial-gradient'] +}); + + +module.exports = Gradient; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-area.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-area.js new file mode 100644 index 00000000..d122b0eb --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-area.js @@ -0,0 +1,86 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); +var shorthand = require('./grid-shorthand'); + +var GridArea = function (_Declaration) { + _inherits(GridArea, _Declaration); + + function GridArea() { + _classCallCheck(this, GridArea); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Translate grid-area to separate -ms- prefixed properties + */ + GridArea.prototype.insert = function insert(decl, prefix, prefixes) { + if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + + if (decl.parent.some(function (i) { + return i.prop === '-ms-grid-row'; + })) { + return undefined; + } + + var values = shorthand.parse(decl); + + var _shorthand$translate = shorthand.translate(values, 0, 2), + rowStart = _shorthand$translate[0], + rowSpan = _shorthand$translate[1]; + + var _shorthand$translate2 = shorthand.translate(values, 1, 3), + columnStart = _shorthand$translate2[0], + columnSpan = _shorthand$translate2[1]; + + if (rowStart) { + decl.cloneBefore({ + prop: '-ms-grid-row', + value: rowStart.toString() + }); + } + + if (rowSpan) { + decl.cloneBefore({ + prop: '-ms-grid-row-span', + value: rowSpan.toString() + }); + } + + if (columnStart) { + decl.cloneBefore({ + prop: '-ms-grid-column', + value: columnStart.toString() + }); + } + + if (columnSpan) { + decl.cloneBefore({ + prop: '-ms-grid-column-span', + value: columnSpan.toString() + }); + } + + return undefined; + }; + + return GridArea; +}(Declaration); + +Object.defineProperty(GridArea, 'names', { + enumerable: true, + writable: true, + value: ['grid-area'] +}); + + +module.exports = GridArea; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-column-align.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-column-align.js new file mode 100644 index 00000000..242f4be7 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-column-align.js @@ -0,0 +1,57 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var GridColumnAlign = function (_Declaration) { + _inherits(GridColumnAlign, _Declaration); + + function GridColumnAlign() { + _classCallCheck(this, GridColumnAlign); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Do not prefix flexbox values + */ + GridColumnAlign.prototype.check = function check(decl) { + return decl.value.indexOf('flex-') === -1 && decl.value !== 'baseline'; + }; + + /** + * Change property name for IE + */ + + + GridColumnAlign.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + 'grid-column-align'; + }; + + /** + * Change IE property back + */ + + + GridColumnAlign.prototype.normalize = function normalize() { + return 'justify-self'; + }; + + return GridColumnAlign; +}(Declaration); + +Object.defineProperty(GridColumnAlign, 'names', { + enumerable: true, + writable: true, + value: ['grid-column-align'] +}); + + +module.exports = GridColumnAlign; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-end.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-end.js new file mode 100644 index 00000000..f148dd10 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-end.js @@ -0,0 +1,73 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var GridEnd = function (_Declaration) { + _inherits(GridEnd, _Declaration); + + function GridEnd() { + _classCallCheck(this, GridEnd); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Do not add prefix for unsupported value in IE + */ + GridEnd.prototype.check = function check(decl) { + return decl.value.indexOf('span') !== -1; + }; + + /** + * Return a final spec property + */ + + + GridEnd.prototype.normalize = function normalize(prop) { + return prop.replace(/(-span|-end)/, ''); + }; + + /** + * Change property name for IE + */ + + + GridEnd.prototype.prefixed = function prefixed(prop, prefix) { + var result = _Declaration.prototype.prefixed.call(this, prop, prefix); + if (prefix === '-ms-') { + result = result.replace('-end', '-span'); + } + return result; + }; + + /** + * Change repeating syntax for IE + */ + + + GridEnd.prototype.set = function set(decl, prefix) { + if (prefix === '-ms-') { + decl.value = decl.value.replace(/span\s/i, ''); + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return GridEnd; +}(Declaration); + +Object.defineProperty(GridEnd, 'names', { + enumerable: true, + writable: true, + value: ['grid-row-end', 'grid-column-end', 'grid-row-span', 'grid-column-span'] +}); + + +module.exports = GridEnd; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-row-align.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-row-align.js new file mode 100644 index 00000000..8a1e634b --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-row-align.js @@ -0,0 +1,57 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var GridRowAlign = function (_Declaration) { + _inherits(GridRowAlign, _Declaration); + + function GridRowAlign() { + _classCallCheck(this, GridRowAlign); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Do not prefix flexbox values + */ + GridRowAlign.prototype.check = function check(decl) { + return decl.value.indexOf('flex-') === -1 && decl.value !== 'baseline'; + }; + + /** + * Change property name for IE + */ + + + GridRowAlign.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + 'grid-row-align'; + }; + + /** + * Change IE property back + */ + + + GridRowAlign.prototype.normalize = function normalize() { + return 'align-self'; + }; + + return GridRowAlign; +}(Declaration); + +Object.defineProperty(GridRowAlign, 'names', { + enumerable: true, + writable: true, + value: ['grid-row-align'] +}); + + +module.exports = GridRowAlign; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-row-column.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-row-column.js new file mode 100644 index 00000000..75b0b150 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-row-column.js @@ -0,0 +1,62 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); +var shorthand = require('./grid-shorthand'); + +var GridRowColumn = function (_Declaration) { + _inherits(GridRowColumn, _Declaration); + + function GridRowColumn() { + _classCallCheck(this, GridRowColumn); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Translate grid-row / grid-column to separate -ms- prefixed properties + */ + GridRowColumn.prototype.insert = function insert(decl, prefix, prefixes) { + if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + + var values = shorthand.parse(decl); + + var _shorthand$translate = shorthand.translate(values, 0, 1), + start = _shorthand$translate[0], + span = _shorthand$translate[1]; + + if (start) { + decl.cloneBefore({ + prop: '-ms-' + decl.prop, + value: start.toString() + }); + } + + if (span) { + decl.cloneBefore({ + prop: '-ms-' + decl.prop + '-span', + value: span.toString() + }); + } + + return undefined; + }; + + return GridRowColumn; +}(Declaration); + +Object.defineProperty(GridRowColumn, 'names', { + enumerable: true, + writable: true, + value: ['grid-row', 'grid-column'] +}); + + +module.exports = GridRowColumn; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js new file mode 100644 index 00000000..af6b8a29 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-rows-columns.js @@ -0,0 +1,65 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); +var shorthand = require('./grid-shorthand'); + +var GridRowsColumns = function (_Declaration) { + _inherits(GridRowsColumns, _Declaration); + + function GridRowsColumns() { + _classCallCheck(this, GridRowsColumns); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for IE + */ + GridRowsColumns.prototype.prefixed = function prefixed(prop, prefix) { + if (prefix === '-ms-') { + return prefix + prop.replace('template-', ''); + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Change IE property back + */ + + + GridRowsColumns.prototype.normalize = function normalize(prop) { + return prop.replace(/^grid-(rows|columns)/, 'grid-template-$1'); + }; + + /** + * Change repeating syntax for IE + */ + + + GridRowsColumns.prototype.set = function set(decl, prefix) { + if (prefix === '-ms-' && decl.value.indexOf('repeat(') !== -1) { + decl.value = shorthand.changeRepeat(decl.value); + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return GridRowsColumns; +}(Declaration); + +Object.defineProperty(GridRowsColumns, 'names', { + enumerable: true, + writable: true, + value: ['grid-template-rows', 'grid-template-columns', 'grid-rows', 'grid-columns'] +}); + + +module.exports = GridRowsColumns; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-shorthand.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-shorthand.js new file mode 100644 index 00000000..8cdcd5b3 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-shorthand.js @@ -0,0 +1,160 @@ +'use strict'; + +var parser = require('postcss-value-parser'); + +function convert(value) { + if (value && value.length === 2 && value[0] === 'span' && parseInt(value[1], 10) > 0) { + return [false, parseInt(value[1], 10)]; + } + + if (value && value.length === 1 && parseInt(value[0], 10) > 0) { + return [parseInt(value[0], 10), false]; + } + + return [false, false]; +} + +function translate(values, startIndex, endIndex) { + var startValue = values[startIndex]; + var endValue = values[endIndex]; + + if (!startValue) { + return [false, false]; + } + + var _convert = convert(startValue), + start = _convert[0], + spanStart = _convert[1]; + + var _convert2 = convert(endValue), + end = _convert2[0], + spanEnd = _convert2[1]; + + if (start && !endValue) { + return [start, false]; + } + + if (spanStart && end) { + return [end - spanStart, spanStart]; + } + + if (start && spanEnd) { + return [start, spanEnd]; + } + + if (start && end) { + return [start, end - start]; + } + + return [false, false]; +} + +function parse(decl) { + var node = parser(decl.value); + + var values = []; + var current = 0; + values[current] = []; + + for (var _iterator = node.nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var i = _ref; + + if (i.type === 'div') { + current += 1; + values[current] = []; + } else if (i.type === 'word') { + values[current].push(i.value); + } + } + + return values; +} + +function parseTemplateShortcut(decl) { + var node = parser(decl.value, { loose: true }); + + var values = []; + var current = 0; + values[current] = []; + + for (var _iterator2 = node.nodes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var i = _ref2; + + if (i.type === 'div') { + current += 1; + values[current] = []; + } else { + values[current].push(parser.stringify(i)); + } + } + + return values; +} + +function walkRepeat(node) { + var fixed = []; + for (var _iterator3 = node.nodes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var i = _ref3; + + if (i.nodes) { + walkRepeat(i); + } + fixed.push(i); + if (i.type === 'function' && i.value === 'repeat') { + var first = i.nodes.shift(); + if (first) { + var count = first.value; + i.nodes.shift(); + i.value = ''; + fixed.push({ type: 'word', value: '[' + count + ']' }); + } + } + } + node.nodes = fixed; +} + +function changeRepeat(value) { + var ast = parser(value); + walkRepeat(ast); + return ast.toString(); +} + +module.exports = { + parse: parse, + translate: translate, + changeRepeat: changeRepeat, + parseTemplateShortcut: parseTemplateShortcut +}; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-start.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-start.js new file mode 100644 index 00000000..33ab920c --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-start.js @@ -0,0 +1,62 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var GridStart = function (_Declaration) { + _inherits(GridStart, _Declaration); + + function GridStart() { + _classCallCheck(this, GridStart); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Do not add prefix for unsupported value in IE + */ + GridStart.prototype.check = function check(decl) { + var value = decl.value; + return value.indexOf('/') === -1 || value.indexOf('span') !== -1; + }; + + /** + * Return a final spec property + */ + + + GridStart.prototype.normalize = function normalize(prop) { + return prop.replace('-start', ''); + }; + + /** + * Change property name for IE + */ + + + GridStart.prototype.prefixed = function prefixed(prop, prefix) { + var result = _Declaration.prototype.prefixed.call(this, prop, prefix); + if (prefix === '-ms-') { + result = result.replace('-start', ''); + } + return result; + }; + + return GridStart; +}(Declaration); + +Object.defineProperty(GridStart, 'names', { + enumerable: true, + writable: true, + value: ['grid-row-start', 'grid-column-start'] +}); + + +module.exports = GridStart; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-template-areas.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-template-areas.js new file mode 100644 index 00000000..08966e61 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-template-areas.js @@ -0,0 +1,137 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var DOTS = /^\.+$/; + +function track(start, end) { + return { start: start, end: end, span: end - start }; +} + +function getRows(tpl) { + return tpl.trim().slice(1, -1).split(/['"]\s*['"]?/g); +} + +function getColumns(line) { + return line.trim().split(/\s+/g); +} + +function parseGridAreas(tpl) { + return getRows(tpl).reduce(function (areas, line, rowIndex) { + if (line.trim() === '') return areas; + getColumns(line).forEach(function (area, columnIndex) { + if (DOTS.test(area)) return; + if (typeof areas[area] === 'undefined') { + areas[area] = { + column: track(columnIndex + 1, columnIndex + 2), + row: track(rowIndex + 1, rowIndex + 2) + }; + } else { + var _areas$area = areas[area], + column = _areas$area.column, + row = _areas$area.row; + + + column.start = Math.min(column.start, columnIndex + 1); + column.end = Math.max(column.end, columnIndex + 2); + column.span = column.end - column.start; + + row.start = Math.min(row.start, rowIndex + 1); + row.end = Math.max(row.end, rowIndex + 2); + row.span = row.end - row.start; + } + }); + return areas; + }, {}); +} + +var GridTemplateAreas = function (_Declaration) { + _inherits(GridTemplateAreas, _Declaration); + + function GridTemplateAreas() { + _classCallCheck(this, GridTemplateAreas); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + GridTemplateAreas.prototype.getRoot = function getRoot(parent) { + if (parent.type === 'atrule' || !parent.parent) { + return parent; + } + return this.getRoot(parent.parent); + }; + + /** + * Translate grid-template-areas to separate -ms- prefixed properties + */ + + + GridTemplateAreas.prototype.insert = function insert(decl, prefix, prefixes, result) { + if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + + var areas = parseGridAreas(decl.value); + var missed = Object.keys(areas); + + this.getRoot(decl.parent).walkDecls('grid-area', function (gridArea) { + var value = gridArea.value; + var area = areas[value]; + + missed = missed.filter(function (e) { + return e !== value; + }); + + if (area) { + gridArea.parent.walkDecls(/-ms-grid-(row|column)/, function (d) { + d.remove(); + }); + + gridArea.cloneBefore({ + prop: '-ms-grid-row', + value: String(area.row.start) + }); + if (area.row.span > 1) { + gridArea.cloneBefore({ + prop: '-ms-grid-row-span', + value: String(area.row.span) + }); + } + gridArea.cloneBefore({ + prop: '-ms-grid-column', + value: String(area.column.start) + }); + if (area.column.span > 1) { + gridArea.cloneBefore({ + prop: '-ms-grid-column-span', + value: String(area.column.span) + }); + } + } + return undefined; + }); + + if (missed.length > 0) { + decl.warn(result, 'Can not find grid areas: ' + missed.join(', ')); + } + + return decl; + }; + + return GridTemplateAreas; +}(Declaration); + +Object.defineProperty(GridTemplateAreas, 'names', { + enumerable: true, + writable: true, + value: ['grid-template-areas'] +}); + + +module.exports = GridTemplateAreas; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-template.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-template.js new file mode 100644 index 00000000..4664f639 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/grid-template.js @@ -0,0 +1,75 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); +var shorthand = require('./grid-shorthand'); + +var GridTemplate = function (_Declaration) { + _inherits(GridTemplate, _Declaration); + + function GridTemplate() { + _classCallCheck(this, GridTemplate); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Do not add prefix for unsupported value in IE + */ + GridTemplate.prototype.check = function check(decl) { + return decl.value.includes('/') && !decl.value.includes('[') && !decl.value.includes('"') && !decl.value.includes('\''); + }; + + /** + * Translate grid-template to separate -ms- prefixed properties + */ + + + GridTemplate.prototype.insert = function insert(decl, prefix, prefixes) { + if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + + if (decl.parent.some(function (i) { + return i.prop === '-ms-grid-rows'; + })) { + return undefined; + } + + var _shorthand$parseTempl = shorthand.parseTemplateShortcut(decl), + templateRows = _shorthand$parseTempl[0], + templateColumns = _shorthand$parseTempl[1]; + + if (templateRows) { + decl.cloneBefore({ + prop: '-ms-grid-rows', + value: shorthand.changeRepeat(templateRows.join('')) + }); + } + + if (templateColumns) { + decl.cloneBefore({ + prop: '-ms-grid-columns', + value: shorthand.changeRepeat(templateColumns.join('')) + }); + } + + return decl; + }; + + return GridTemplate; +}(Declaration); + +Object.defineProperty(GridTemplate, 'names', { + enumerable: true, + writable: true, + value: ['grid-template'] +}); + + +module.exports = GridTemplate; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/image-rendering.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/image-rendering.js new file mode 100644 index 00000000..9331fadb --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/image-rendering.js @@ -0,0 +1,82 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var ImageRendering = function (_Declaration) { + _inherits(ImageRendering, _Declaration); + + function ImageRendering() { + _classCallCheck(this, ImageRendering); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Add hack only for crisp-edges + */ + ImageRendering.prototype.check = function check(decl) { + return decl.value === 'pixelated'; + }; + + /** + * Change property name for IE + */ + + + ImageRendering.prototype.prefixed = function prefixed(prop, prefix) { + if (prefix === '-ms-') { + return '-ms-interpolation-mode'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Change property and value for IE + */ + + + ImageRendering.prototype.set = function set(decl, prefix) { + if (prefix !== '-ms-') return _Declaration.prototype.set.call(this, decl, prefix); + decl.prop = '-ms-interpolation-mode'; + decl.value = 'nearest-neighbor'; + return decl; + }; + + /** + * Return property name by spec + */ + + + ImageRendering.prototype.normalize = function normalize() { + return 'image-rendering'; + }; + + /** + * Warn on old value + */ + + + ImageRendering.prototype.process = function process(node, result) { + return _Declaration.prototype.process.call(this, node, result); + }; + + return ImageRendering; +}(Declaration); + +Object.defineProperty(ImageRendering, 'names', { + enumerable: true, + writable: true, + value: ['image-rendering', 'interpolation-mode'] +}); + + +module.exports = ImageRendering; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/image-set.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/image-set.js new file mode 100644 index 00000000..7af5255a --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/image-set.js @@ -0,0 +1,43 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Value = require('../value'); + +var ImageSet = function (_Value) { + _inherits(ImageSet, _Value); + + function ImageSet() { + _classCallCheck(this, ImageSet); + + return _possibleConstructorReturn(this, _Value.apply(this, arguments)); + } + + /** + * Use non-standard name for WebKit and Firefox + */ + ImageSet.prototype.replace = function replace(string, prefix) { + var fixed = _Value.prototype.replace.call(this, string, prefix); + if (prefix === '-webkit-') { + fixed = fixed.replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi, 'url($1)$2'); + } + return fixed; + }; + + return ImageSet; +}(Value); + +Object.defineProperty(ImageSet, 'names', { + enumerable: true, + writable: true, + value: ['image-set'] +}); + + +module.exports = ImageSet; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/inline-logical.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/inline-logical.js new file mode 100644 index 00000000..7de072ac --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/inline-logical.js @@ -0,0 +1,48 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var InlineLogical = function (_Declaration) { + _inherits(InlineLogical, _Declaration); + + function InlineLogical() { + _classCallCheck(this, InlineLogical); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Use old syntax for -moz- and -webkit- + */ + InlineLogical.prototype.prefixed = function prefixed(prop, prefix) { + return prefix + prop.replace('-inline', ''); + }; + + /** + * Return property name by spec + */ + + + InlineLogical.prototype.normalize = function normalize(prop) { + return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2'); + }; + + return InlineLogical; +}(Declaration); + +Object.defineProperty(InlineLogical, 'names', { + enumerable: true, + writable: true, + value: ['border-inline-start', 'border-inline-end', 'margin-inline-start', 'margin-inline-end', 'padding-inline-start', 'padding-inline-end', 'border-start', 'border-end', 'margin-start', 'margin-end', 'padding-start', 'padding-end'] +}); + + +module.exports = InlineLogical; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/intrinsic.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/intrinsic.js new file mode 100644 index 00000000..af424a28 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/intrinsic.js @@ -0,0 +1,75 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var OldValue = require('../old-value'); +var Value = require('../value'); + +function _regexp(name) { + return new RegExp('(^|[\\s,(])(' + name + '($|[\\s),]))', 'gi'); +} + +var Intrinsic = function (_Value) { + _inherits(Intrinsic, _Value); + + function Intrinsic() { + _classCallCheck(this, Intrinsic); + + return _possibleConstructorReturn(this, _Value.apply(this, arguments)); + } + + Intrinsic.prototype.regexp = function regexp() { + if (!this.regexpCache) this.regexpCache = _regexp(this.name); + return this.regexpCache; + }; + + Intrinsic.prototype.isStretch = function isStretch() { + return this.name === 'stretch' || this.name === 'fill' || this.name === 'fill-available'; + }; + + Intrinsic.prototype.replace = function replace(string, prefix) { + if (prefix === '-moz-' && this.isStretch()) { + return string.replace(this.regexp(), '$1-moz-available$3'); + } else if (prefix === '-webkit-' && this.isStretch()) { + return string.replace(this.regexp(), '$1-webkit-fill-available$3'); + } else { + return _Value.prototype.replace.call(this, string, prefix); + } + }; + + Intrinsic.prototype.old = function old(prefix) { + var prefixed = prefix + this.name; + if (this.isStretch()) { + if (prefix === '-moz-') { + prefixed = '-moz-available'; + } else if (prefix === '-webkit-') { + prefixed = '-webkit-fill-available'; + } + } + return new OldValue(this.name, prefixed, prefixed, _regexp(prefixed)); + }; + + Intrinsic.prototype.add = function add(decl, prefix) { + if (decl.prop.indexOf('grid') !== -1 && prefix !== '-webkit-') { + return undefined; + } + return _Value.prototype.add.call(this, decl, prefix); + }; + + return Intrinsic; +}(Value); + +Object.defineProperty(Intrinsic, 'names', { + enumerable: true, + writable: true, + value: ['max-content', 'min-content', 'fit-content', 'fill', 'fill-available', 'stretch'] +}); + + +module.exports = Intrinsic; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/justify-content.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/justify-content.js new file mode 100644 index 00000000..f6075b56 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/justify-content.js @@ -0,0 +1,91 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var JustifyContent = function (_Declaration) { + _inherits(JustifyContent, _Declaration); + + function JustifyContent() { + _classCallCheck(this, JustifyContent); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2009 and 2012 specs + */ + JustifyContent.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2009) { + return prefix + 'box-pack'; + } else if (spec === 2012) { + return prefix + 'flex-pack'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + JustifyContent.prototype.normalize = function normalize() { + return 'justify-content'; + }; + + /** + * Change value for 2009 and 2012 specs + */ + + + JustifyContent.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2009 || spec === 2012) { + var value = JustifyContent.oldValues[decl.value] || decl.value; + decl.value = value; + if (spec !== 2009 || value !== 'distribute') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + } else if (spec === 'final') { + return _Declaration.prototype.set.call(this, decl, prefix); + } + return undefined; + }; + + return JustifyContent; +}(Declaration); + +Object.defineProperty(JustifyContent, 'names', { + enumerable: true, + writable: true, + value: ['justify-content', 'flex-pack', 'box-pack'] +}); +Object.defineProperty(JustifyContent, 'oldValues', { + enumerable: true, + writable: true, + value: { + 'flex-end': 'end', + 'flex-start': 'start', + 'space-between': 'justify', + 'space-around': 'distribute' + } +}); + + +module.exports = JustifyContent; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/mask-border.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/mask-border.js new file mode 100644 index 00000000..79a0d554 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/mask-border.js @@ -0,0 +1,52 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var MaskBorder = function (_Declaration) { + _inherits(MaskBorder, _Declaration); + + function MaskBorder() { + _classCallCheck(this, MaskBorder); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Return property name by final spec + */ + MaskBorder.prototype.normalize = function normalize() { + return this.name.replace('box-image', 'border'); + }; + + /** + * Return flex property for 2012 spec + */ + + + MaskBorder.prototype.prefixed = function prefixed(prop, prefix) { + var result = _Declaration.prototype.prefixed.call(this, prop, prefix); + if (prefix === '-webkit-') { + result = result.replace('border', 'box-image'); + } + return result; + }; + + return MaskBorder; +}(Declaration); + +Object.defineProperty(MaskBorder, 'names', { + enumerable: true, + writable: true, + value: ['mask-border', 'mask-border-source', 'mask-border-slice', 'mask-border-width', 'mask-border-outset', 'mask-border-repeat', 'mask-box-image', 'mask-box-image-source', 'mask-box-image-slice', 'mask-box-image-width', 'mask-box-image-outset', 'mask-box-image-repeat'] +}); + + +module.exports = MaskBorder; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/order.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/order.js new file mode 100644 index 00000000..b6f6110a --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/order.js @@ -0,0 +1,77 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var flexSpec = require('./flex-spec'); +var Declaration = require('../declaration'); + +var Order = function (_Declaration) { + _inherits(Order, _Declaration); + + function Order() { + _classCallCheck(this, Order); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Change property name for 2009 and 2012 specs + */ + Order.prototype.prefixed = function prefixed(prop, prefix) { + var spec = void 0; + + var _flexSpec = flexSpec(prefix); + + spec = _flexSpec[0]; + prefix = _flexSpec[1]; + + if (spec === 2009) { + return prefix + 'box-ordinal-group'; + } else if (spec === 2012) { + return prefix + 'flex-order'; + } else { + return _Declaration.prototype.prefixed.call(this, prop, prefix); + } + }; + + /** + * Return property name by final spec + */ + + + Order.prototype.normalize = function normalize() { + return 'order'; + }; + + /** + * Fix value for 2009 spec + */ + + + Order.prototype.set = function set(decl, prefix) { + var spec = flexSpec(prefix)[0]; + if (spec === 2009 && /\d/.test(decl.value)) { + decl.value = (parseInt(decl.value) + 1).toString(); + return _Declaration.prototype.set.call(this, decl, prefix); + } else { + return _Declaration.prototype.set.call(this, decl, prefix); + } + }; + + return Order; +}(Declaration); + +Object.defineProperty(Order, 'names', { + enumerable: true, + writable: true, + value: ['order', 'flex-order', 'box-ordinal-group'] +}); + + +module.exports = Order; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/pixelated.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/pixelated.js new file mode 100644 index 00000000..dd5dddb6 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/pixelated.js @@ -0,0 +1,61 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var OldValue = require('../old-value'); +var Value = require('../value'); + +var Pixelated = function (_Value) { + _inherits(Pixelated, _Value); + + function Pixelated() { + _classCallCheck(this, Pixelated); + + return _possibleConstructorReturn(this, _Value.apply(this, arguments)); + } + + /** + * Use non-standard name for WebKit and Firefox + */ + Pixelated.prototype.replace = function replace(string, prefix) { + if (prefix === '-webkit-') { + return string.replace(this.regexp(), '$1-webkit-optimize-contrast'); + } else if (prefix === '-moz-') { + return string.replace(this.regexp(), '$1-moz-crisp-edges'); + } else { + return _Value.prototype.replace.call(this, string, prefix); + } + }; + + /** + * Different name for WebKit and Firefox + */ + + + Pixelated.prototype.old = function old(prefix) { + if (prefix === '-webkit-') { + return new OldValue(this.name, '-webkit-optimize-contrast'); + } else if (prefix === '-moz-') { + return new OldValue(this.name, '-moz-crisp-edges'); + } else { + return _Value.prototype.old.call(this, prefix); + } + }; + + return Pixelated; +}(Value); + +Object.defineProperty(Pixelated, 'names', { + enumerable: true, + writable: true, + value: ['pixelated'] +}); + + +module.exports = Pixelated; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/placeholder.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/placeholder.js new file mode 100644 index 00000000..27a3064e --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/placeholder.js @@ -0,0 +1,58 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Selector = require('../selector'); + +var Placeholder = function (_Selector) { + _inherits(Placeholder, _Selector); + + function Placeholder() { + _classCallCheck(this, Placeholder); + + return _possibleConstructorReturn(this, _Selector.apply(this, arguments)); + } + + /** + * Add old mozilla to possible prefixes + */ + Placeholder.prototype.possible = function possible() { + return _Selector.prototype.possible.call(this).concat(['-moz- old', '-ms- old']); + }; + + /** + * Return different selectors depend on prefix + */ + + + Placeholder.prototype.prefixed = function prefixed(prefix) { + if (prefix === '-webkit-') { + return '::-webkit-input-placeholder'; + } else if (prefix === '-ms-') { + return '::-ms-input-placeholder'; + } else if (prefix === '-ms- old') { + return ':-ms-input-placeholder'; + } else if (prefix === '-moz- old') { + return ':-moz-placeholder'; + } else { + return '::' + prefix + 'placeholder'; + } + }; + + return Placeholder; +}(Selector); + +Object.defineProperty(Placeholder, 'names', { + enumerable: true, + writable: true, + value: ['::placeholder'] +}); + + +module.exports = Placeholder; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/text-decoration.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/text-decoration.js new file mode 100644 index 00000000..c1b44e06 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/text-decoration.js @@ -0,0 +1,43 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var BASIC = ['none', 'underline', 'overline', 'line-through', 'blink', 'inherit', 'initial', 'unset']; + +var TextDecoration = function (_Declaration) { + _inherits(TextDecoration, _Declaration); + + function TextDecoration() { + _classCallCheck(this, TextDecoration); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Do not add prefixes for basic values. + */ + TextDecoration.prototype.check = function check(decl) { + return decl.value.split(/\s+/).some(function (i) { + return BASIC.indexOf(i) === -1; + }); + }; + + return TextDecoration; +}(Declaration); + +Object.defineProperty(TextDecoration, 'names', { + enumerable: true, + writable: true, + value: ['text-decoration'] +}); + + +module.exports = TextDecoration; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js new file mode 100644 index 00000000..fe0b4283 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/text-emphasis-position.js @@ -0,0 +1,39 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var TextEmphasisPosition = function (_Declaration) { + _inherits(TextEmphasisPosition, _Declaration); + + function TextEmphasisPosition() { + _classCallCheck(this, TextEmphasisPosition); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + TextEmphasisPosition.prototype.set = function set(decl, prefix) { + if (prefix === '-webkit-') { + decl.value = decl.value.replace(/\s*(right|left)\s*/i, ''); + } + return _Declaration.prototype.set.call(this, decl, prefix); + }; + + return TextEmphasisPosition; +}(Declaration); + +Object.defineProperty(TextEmphasisPosition, 'names', { + enumerable: true, + writable: true, + value: ['text-emphasis-position'] +}); + + +module.exports = TextEmphasisPosition; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/transform-decl.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/transform-decl.js new file mode 100644 index 00000000..747bf1d0 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/transform-decl.js @@ -0,0 +1,118 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var TransformDecl = function (_Declaration) { + _inherits(TransformDecl, _Declaration); + + function TransformDecl() { + _classCallCheck(this, TransformDecl); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + /** + * Recursively check all parents for @keyframes + */ + TransformDecl.prototype.keyframeParents = function keyframeParents(decl) { + var parent = decl.parent; + + while (parent) { + if (parent.type === 'atrule' && parent.name === 'keyframes') { + return true; + } + var _parent = parent; + parent = _parent.parent; + } + return false; + }; + + /** + * Is transform contain 3D commands + */ + + + TransformDecl.prototype.contain3d = function contain3d(decl) { + if (decl.prop === 'transform-origin') { + return false; + } + + for (var _iterator = TransformDecl.functions3d, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var func = _ref; + + if (decl.value.indexOf(func + '(') !== -1) { + return true; + } + } + + return false; + }; + + /** + * Replace rotateZ to rotate for IE 9 + */ + + + TransformDecl.prototype.set = function set(decl, prefix) { + decl = _Declaration.prototype.set.call(this, decl, prefix); + if (prefix === '-ms-') { + decl.value = decl.value.replace(/rotateZ/gi, 'rotate'); + } + return decl; + }; + + /** + * Don't add prefix for IE in keyframes + */ + + + TransformDecl.prototype.insert = function insert(decl, prefix, prefixes) { + if (prefix === '-ms-') { + if (!this.contain3d(decl) && !this.keyframeParents(decl)) { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } + } else if (prefix === '-o-') { + if (!this.contain3d(decl)) { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } + } else { + return _Declaration.prototype.insert.call(this, decl, prefix, prefixes); + } + return undefined; + }; + + return TransformDecl; +}(Declaration); + +Object.defineProperty(TransformDecl, 'names', { + enumerable: true, + writable: true, + value: ['transform', 'transform-origin'] +}); +Object.defineProperty(TransformDecl, 'functions3d', { + enumerable: true, + writable: true, + value: ['matrix3d', 'translate3d', 'translateZ', 'scale3d', 'scaleZ', 'rotate3d', 'rotateX', 'rotateY', 'perspective'] +}); + + +module.exports = TransformDecl; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/writing-mode.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/writing-mode.js new file mode 100644 index 00000000..672060e0 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/hacks/writing-mode.js @@ -0,0 +1,50 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Declaration = require('../declaration'); + +var WritingMode = function (_Declaration) { + _inherits(WritingMode, _Declaration); + + function WritingMode() { + _classCallCheck(this, WritingMode); + + return _possibleConstructorReturn(this, _Declaration.apply(this, arguments)); + } + + WritingMode.prototype.set = function set(decl, prefix) { + if (prefix === '-ms-') { + decl.value = WritingMode.msValues[decl.value] || decl.value; + return _Declaration.prototype.set.call(this, decl, prefix); + } else { + return _Declaration.prototype.set.call(this, decl, prefix); + } + }; + + return WritingMode; +}(Declaration); + +Object.defineProperty(WritingMode, 'names', { + enumerable: true, + writable: true, + value: ['writing-mode'] +}); +Object.defineProperty(WritingMode, 'msValues', { + enumerable: true, + writable: true, + value: { + 'horizontal-tb': 'lr-tb', + 'vertical-rl': 'tb-rl', + 'vertical-lr': 'tb-lr' + } +}); + + +module.exports = WritingMode; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/info.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/info.js new file mode 100644 index 00000000..f7440021 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/info.js @@ -0,0 +1,152 @@ +'use strict'; + +var browserslist = require('browserslist'); + +function capitalize(str) { + return str.slice(0, 1).toUpperCase() + str.slice(1); +} + +var names = { + ie: 'IE', + ie_mob: 'IE Mobile', + ios_saf: 'iOS', + op_mini: 'Opera Mini', + op_mob: 'Opera Mobile', + and_chr: 'Chrome for Android', + and_ff: 'Firefox for Android', + and_uc: 'UC for Android' +}; + +var prefix = function prefix(name, prefixes) { + var out = ' ' + name + ': '; + out += prefixes.map(function (i) { + return i.replace(/^-(.*)-$/g, '$1'); + }).join(', '); + out += '\n'; + return out; +}; + +module.exports = function (prefixes) { + if (prefixes.browsers.selected.length === 0) { + return 'No browsers selected'; + } + + var versions = {}; + for (var _iterator = prefixes.browsers.selected, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var browser = _ref; + + var _browser$split = browser.split(' '), + name = _browser$split[0], + version = _browser$split[1]; + + name = names[name] || capitalize(name); + if (versions[name]) { + versions[name].push(version); + } else { + versions[name] = [version]; + } + } + + var out = 'Browsers:\n'; + for (var _browser in versions) { + var list = versions[_browser]; + list = list.sort(function (a, b) { + return parseFloat(b) - parseFloat(a); + }); + out += ' ' + _browser + ': ' + list.join(', ') + '\n'; + } + + var coverage = browserslist.coverage(prefixes.browsers.selected); + var round = Math.round(coverage * 100) / 100.0; + out += '\nThese browsers account for ' + round + '% of all users globally\n'; + + var atrules = ''; + for (var name in prefixes.add) { + var data = prefixes.add[name]; + if (name[0] === '@' && data.prefixes) { + atrules += prefix(name, data.prefixes); + } + } + if (atrules !== '') { + out += '\nAt-Rules:\n' + atrules; + } + + var selectors = ''; + for (var _iterator2 = prefixes.add.selectors, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var selector = _ref2; + + if (selector.prefixes) { + selectors += prefix(selector.name, selector.prefixes); + } + } + if (selectors !== '') { + out += '\nSelectors:\n' + selectors; + } + + var values = ''; + var props = ''; + for (var _name in prefixes.add) { + var _data = prefixes.add[_name]; + if (_name[0] !== '@' && _data.prefixes) { + props += prefix(_name, _data.prefixes); + } + + if (!_data.values) { + continue; + } + for (var _iterator3 = _data.values, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var value = _ref3; + + var string = prefix(value.name, value.prefixes); + if (values.indexOf(string) === -1) { + values += string; + } + } + } + + if (props !== '') { + out += '\nProperties:\n' + props; + } + if (values !== '') { + out += '\nValues:\n' + values; + } + + if (atrules === '' && selectors === '' && props === '' && values === '') { + out += '\nAwesome! Your browsers don\'t require any vendor prefixes.' + '\nNow you can remove Autoprefixer from build steps.'; + } + + return out; +}; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/old-selector.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/old-selector.js new file mode 100644 index 00000000..e129fdda --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/old-selector.js @@ -0,0 +1,94 @@ +"use strict"; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var OldSelector = function () { + function OldSelector(selector, prefix) { + _classCallCheck(this, OldSelector); + + this.prefix = prefix; + this.prefixed = selector.prefixed(this.prefix); + this.regexp = selector.regexp(this.prefix); + + this.prefixeds = selector.possible().map(function (x) { + return [selector.prefixed(x), selector.regexp(x)]; + }); + + this.unprefixed = selector.name; + this.nameRegexp = selector.regexp(); + } + + /** + * Is rule a hack without unprefixed version bottom + */ + + + OldSelector.prototype.isHack = function isHack(rule) { + var index = rule.parent.index(rule) + 1; + var rules = rule.parent.nodes; + + while (index < rules.length) { + var before = rules[index].selector; + if (!before) { + return true; + } + + if (before.indexOf(this.unprefixed) !== -1 && before.match(this.nameRegexp)) { + return false; + } + + var some = false; + for (var _iterator = this.prefixeds, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var _ref = _ref2; + var string = _ref[0]; + var regexp = _ref[1]; + + if (before.indexOf(string) !== -1 && before.match(regexp)) { + some = true; + break; + } + } + + if (!some) { + return true; + } + + index += 1; + } + + return true; + }; + + /** + * Does rule contain an unnecessary prefixed selector + */ + + + OldSelector.prototype.check = function check(rule) { + if (rule.selector.indexOf(this.prefixed) === -1) { + return false; + } + if (!rule.selector.match(this.regexp)) { + return false; + } + if (this.isHack(rule)) { + return false; + } + return true; + }; + + return OldSelector; +}(); + +module.exports = OldSelector; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/old-value.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/old-value.js new file mode 100644 index 00000000..c8ffd9b6 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/old-value.js @@ -0,0 +1,32 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var utils = require('./utils'); + +var OldValue = function () { + function OldValue(unprefixed, prefixed, string, regexp) { + _classCallCheck(this, OldValue); + + this.unprefixed = unprefixed; + this.prefixed = prefixed; + this.string = string || prefixed; + this.regexp = regexp || utils.regexp(prefixed); + } + + /** + * Check, that value contain old value + */ + + + OldValue.prototype.check = function check(value) { + if (value.indexOf(this.string) !== -1) { + return !!value.match(this.regexp); + } + return false; + }; + + return OldValue; +}(); + +module.exports = OldValue; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/prefixer.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/prefixer.js new file mode 100644 index 00000000..533e2287 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/prefixer.js @@ -0,0 +1,188 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Browsers = require('./browsers'); +var utils = require('./utils'); + +var vendor = require('postcss').vendor; + +/** + * Recursivly clone objects + */ +function _clone(obj, parent) { + var cloned = new obj.constructor(); + + for (var _iterator = Object.keys(obj || {}), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var i = _ref; + + var value = obj[i]; + if (i === 'parent' && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') { + if (parent) { + cloned[i] = parent; + } + } else if (i === 'source' || i === null) { + cloned[i] = value; + } else if (value instanceof Array) { + cloned[i] = value.map(function (x) { + return _clone(x, cloned); + }); + } else if (i !== '_autoprefixerPrefix' && i !== '_autoprefixerValues') { + if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value !== null) { + value = _clone(value, cloned); + } + cloned[i] = value; + } + } + + return cloned; +} + +var Prefixer = function () { + + /** + * Add hack to selected names + */ + Prefixer.hack = function hack(klass) { + var _this = this; + + if (!this.hacks) { + this.hacks = {}; + } + return klass.names.map(function (name) { + _this.hacks[name] = klass; + return _this.hacks[name]; + }); + }; + + /** + * Load hacks for some names + */ + + + Prefixer.load = function load(name, prefixes, all) { + var Klass = this.hacks && this.hacks[name]; + if (Klass) { + return new Klass(name, prefixes, all); + } else { + return new this(name, prefixes, all); + } + }; + + /** + * Clone node and clean autprefixer custom caches + */ + + + Prefixer.clone = function clone(node, overrides) { + var cloned = _clone(node); + for (var name in overrides) { + cloned[name] = overrides[name]; + } + return cloned; + }; + + function Prefixer(name, prefixes, all) { + _classCallCheck(this, Prefixer); + + this.name = name; + this.prefixes = prefixes; + this.all = all; + } + + /** + * Find prefix in node parents + */ + + + Prefixer.prototype.parentPrefix = function parentPrefix(node) { + var prefix = void 0; + + if (typeof node._autoprefixerPrefix !== 'undefined') { + prefix = node._autoprefixerPrefix; + } else if (node.type === 'decl' && node.prop[0] === '-') { + prefix = vendor.prefix(node.prop); + } else if (node.type === 'root') { + prefix = false; + } else if (node.type === 'rule' && node.selector.indexOf(':-') !== -1 && /:(-\w+-)/.test(node.selector)) { + prefix = node.selector.match(/:(-\w+-)/)[1]; + } else if (node.type === 'atrule' && node.name[0] === '-') { + prefix = vendor.prefix(node.name); + } else { + prefix = this.parentPrefix(node.parent); + } + + if (Browsers.prefixes().indexOf(prefix) === -1) { + prefix = false; + } + + node._autoprefixerPrefix = prefix; + + return node._autoprefixerPrefix; + }; + + /** + * Clone node with prefixes + */ + + + Prefixer.prototype.process = function process(node, result) { + if (!this.check(node)) { + return undefined; + } + + var parent = this.parentPrefix(node); + + var prefixes = this.prefixes.filter(function (prefix) { + return !parent || parent === utils.removeNote(prefix); + }); + + var added = []; + for (var _iterator2 = prefixes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var prefix = _ref2; + + if (this.add(node, prefix, added.concat([prefix]), result)) { + added.push(prefix); + } + } + + return added; + }; + + /** + * Shortcut for Prefixer.clone + */ + + + Prefixer.prototype.clone = function clone(node, overrides) { + return Prefixer.clone(node, overrides); + }; + + return Prefixer; +}(); + +module.exports = Prefixer; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/prefixes.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/prefixes.js new file mode 100644 index 00000000..f84d9182 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/prefixes.js @@ -0,0 +1,510 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Declaration = require('./declaration'); +var Resolution = require('./resolution'); +var Transition = require('./transition'); +var Processor = require('./processor'); +var Supports = require('./supports'); +var Browsers = require('./browsers'); +var Selector = require('./selector'); +var AtRule = require('./at-rule'); +var Value = require('./value'); +var utils = require('./utils'); + +var vendor = require('postcss').vendor; + +Selector.hack(require('./hacks/fullscreen')); +Selector.hack(require('./hacks/placeholder')); + +Declaration.hack(require('./hacks/flex')); +Declaration.hack(require('./hacks/order')); +Declaration.hack(require('./hacks/filter')); +Declaration.hack(require('./hacks/grid-end')); +Declaration.hack(require('./hacks/animation')); +Declaration.hack(require('./hacks/flex-flow')); +Declaration.hack(require('./hacks/flex-grow')); +Declaration.hack(require('./hacks/flex-wrap')); +Declaration.hack(require('./hacks/grid-area')); +Declaration.hack(require('./hacks/grid-start')); +Declaration.hack(require('./hacks/align-self')); +Declaration.hack(require('./hacks/appearance')); +Declaration.hack(require('./hacks/flex-basis')); +Declaration.hack(require('./hacks/mask-border')); +Declaration.hack(require('./hacks/align-items')); +Declaration.hack(require('./hacks/flex-shrink')); +Declaration.hack(require('./hacks/break-props')); +Declaration.hack(require('./hacks/writing-mode')); +Declaration.hack(require('./hacks/border-image')); +Declaration.hack(require('./hacks/align-content')); +Declaration.hack(require('./hacks/border-radius')); +Declaration.hack(require('./hacks/block-logical')); +Declaration.hack(require('./hacks/grid-template')); +Declaration.hack(require('./hacks/inline-logical')); +Declaration.hack(require('./hacks/grid-row-align')); +Declaration.hack(require('./hacks/transform-decl')); +Declaration.hack(require('./hacks/flex-direction')); +Declaration.hack(require('./hacks/image-rendering')); +Declaration.hack(require('./hacks/text-decoration')); +Declaration.hack(require('./hacks/justify-content')); +Declaration.hack(require('./hacks/background-size')); +Declaration.hack(require('./hacks/grid-row-column')); +Declaration.hack(require('./hacks/grid-rows-columns')); +Declaration.hack(require('./hacks/grid-column-align')); +Declaration.hack(require('./hacks/grid-template-areas')); +Declaration.hack(require('./hacks/text-emphasis-position')); + +Value.hack(require('./hacks/gradient')); +Value.hack(require('./hacks/intrinsic')); +Value.hack(require('./hacks/pixelated')); +Value.hack(require('./hacks/image-set')); +Value.hack(require('./hacks/cross-fade')); +Value.hack(require('./hacks/display-flex')); +Value.hack(require('./hacks/display-grid')); +Value.hack(require('./hacks/filter-value')); + +var declsCache = {}; + +var Prefixes = function () { + function Prefixes(data, browsers) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + _classCallCheck(this, Prefixes); + + this.data = data; + this.browsers = browsers; + this.options = options; + + var _preprocess = this.preprocess(this.select(this.data)); + + this.add = _preprocess[0]; + this.remove = _preprocess[1]; + + this.transition = new Transition(this); + this.processor = new Processor(this); + } + + /** + * Return clone instance to remove all prefixes + */ + + + Prefixes.prototype.cleaner = function cleaner() { + if (this.cleanerCache) { + return this.cleanerCache; + } + + if (this.browsers.selected.length) { + var empty = new Browsers(this.browsers.data, []); + this.cleanerCache = new Prefixes(this.data, empty, this.options); + } else { + return this; + } + + return this.cleanerCache; + }; + + /** + * Select prefixes from data, which is necessary for selected browsers + */ + + + Prefixes.prototype.select = function select(list) { + var _this = this; + + var selected = { add: {}, remove: {} }; + + var _loop = function _loop(name) { + var data = list[name]; + var add = data.browsers.map(function (i) { + var params = i.split(' '); + return { + browser: params[0] + ' ' + params[1], + note: params[2] + }; + }); + + var notes = add.filter(function (i) { + return i.note; + }).map(function (i) { + return _this.browsers.prefix(i.browser) + ' ' + i.note; + }); + notes = utils.uniq(notes); + + add = add.filter(function (i) { + return _this.browsers.isSelected(i.browser); + }).map(function (i) { + var prefix = _this.browsers.prefix(i.browser); + if (i.note) { + return prefix + ' ' + i.note; + } else { + return prefix; + } + }); + add = _this.sort(utils.uniq(add)); + + if (_this.options.flexbox === 'no-2009') { + add = add.filter(function (i) { + return i.indexOf('2009') === -1; + }); + } + + var all = data.browsers.map(function (i) { + return _this.browsers.prefix(i); + }); + if (data.mistakes) { + all = all.concat(data.mistakes); + } + all = all.concat(notes); + all = utils.uniq(all); + + if (add.length) { + selected.add[name] = add; + if (add.length < all.length) { + selected.remove[name] = all.filter(function (i) { + return add.indexOf(i) === -1; + }); + } + } else { + selected.remove[name] = all; + } + }; + + for (var name in list) { + _loop(name); + } + + return selected; + }; + + /** + * Sort vendor prefixes + */ + + + Prefixes.prototype.sort = function sort(prefixes) { + return prefixes.sort(function (a, b) { + var aLength = utils.removeNote(a).length; + var bLength = utils.removeNote(b).length; + + if (aLength === bLength) { + return b.length - a.length; + } else { + return bLength - aLength; + } + }); + }; + + /** + * Cache prefixes data to fast CSS processing + */ + + + Prefixes.prototype.preprocess = function preprocess(selected) { + var add = { + 'selectors': [], + '@supports': new Supports(Prefixes, this) + }; + for (var name in selected.add) { + var prefixes = selected.add[name]; + if (name === '@keyframes' || name === '@viewport') { + add[name] = new AtRule(name, prefixes, this); + } else if (name === '@resolution') { + add[name] = new Resolution(name, prefixes, this); + } else if (this.data[name].selector) { + add.selectors.push(Selector.load(name, prefixes, this)); + } else { + var props = this.data[name].props; + + if (props) { + var value = Value.load(name, prefixes, this); + for (var _iterator = props, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var prop = _ref; + + if (!add[prop]) { + add[prop] = { values: [] }; + } + add[prop].values.push(value); + } + } else { + var values = add[name] && add[name].values || []; + add[name] = Declaration.load(name, prefixes, this); + add[name].values = values; + } + } + } + + var remove = { selectors: [] }; + for (var _name in selected.remove) { + var _prefixes = selected.remove[_name]; + if (this.data[_name].selector) { + var selector = Selector.load(_name, _prefixes); + for (var _iterator2 = _prefixes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var prefix = _ref2; + + remove.selectors.push(selector.old(prefix)); + } + } else if (_name === '@keyframes' || _name === '@viewport') { + for (var _iterator3 = _prefixes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var _prefix = _ref3; + + var prefixed = '@' + _prefix + _name.slice(1); + remove[prefixed] = { remove: true }; + } + } else if (_name === '@resolution') { + remove[_name] = new Resolution(_name, _prefixes, this); + } else { + var _props = this.data[_name].props; + if (_props) { + var _value = Value.load(_name, [], this); + for (var _iterator4 = _prefixes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var _prefix2 = _ref4; + + var old = _value.old(_prefix2); + if (old) { + for (var _iterator5 = _props, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref5; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref5 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref5 = _i5.value; + } + + var _prop = _ref5; + + if (!remove[_prop]) { + remove[_prop] = {}; + } + if (!remove[_prop].values) { + remove[_prop].values = []; + } + remove[_prop].values.push(old); + } + } + } + } else { + for (var _iterator6 = _prefixes, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref6; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref6 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref6 = _i6.value; + } + + var _prefix3 = _ref6; + + var olds = this.decl(_name).old(_name, _prefix3); + if (_name === 'align-self') { + var a = add[_name] && add[_name].prefixes; + if (a) { + if (_prefix3 === '-webkit- 2009' && a.indexOf('-webkit-') !== -1) { + continue; + } else if (_prefix3 === '-webkit-' && a.indexOf('-webkit- 2009') !== -1) { + continue; + } + } + } + for (var _iterator7 = olds, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref7; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref7 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref7 = _i7.value; + } + + var _prefixed = _ref7; + + if (!remove[_prefixed]) { + remove[_prefixed] = {}; + } + remove[_prefixed].remove = true; + } + } + } + } + } + + return [add, remove]; + }; + + /** + * Declaration loader with caching + */ + + + Prefixes.prototype.decl = function decl(prop) { + var decl = declsCache[prop]; + + if (decl) { + return decl; + } else { + declsCache[prop] = Declaration.load(prop); + return declsCache[prop]; + } + }; + + /** + * Return unprefixed version of property + */ + + + Prefixes.prototype.unprefixed = function unprefixed(prop) { + var value = this.normalize(vendor.unprefixed(prop)); + if (value === 'flex-direction') { + value = 'flex-flow'; + } + return value; + }; + + /** + * Normalize prefix for remover + */ + + + Prefixes.prototype.normalize = function normalize(prop) { + return this.decl(prop).normalize(prop); + }; + + /** + * Return prefixed version of property + */ + + + Prefixes.prototype.prefixed = function prefixed(prop, prefix) { + prop = vendor.unprefixed(prop); + return this.decl(prop).prefixed(prop, prefix); + }; + + /** + * Return values, which must be prefixed in selected property + */ + + + Prefixes.prototype.values = function values(type, prop) { + var data = this[type]; + + var global = data['*'] && data['*'].values; + var values = data[prop] && data[prop].values; + + if (global && values) { + return utils.uniq(global.concat(values)); + } else { + return global || values || []; + } + }; + + /** + * Group declaration by unprefixed property to check them + */ + + + Prefixes.prototype.group = function group(decl) { + var _this2 = this; + + var rule = decl.parent; + var index = rule.index(decl); + var length = rule.nodes.length; + + var unprefixed = this.unprefixed(decl.prop); + + var checker = function checker(step, callback) { + index += step; + while (index >= 0 && index < length) { + var other = rule.nodes[index]; + if (other.type === 'decl') { + + if (step === -1 && other.prop === unprefixed) { + if (!Browsers.withPrefix(other.value)) { + break; + } + } + + if (_this2.unprefixed(other.prop) !== unprefixed) { + break; + } else if (callback(other) === true) { + return true; + } + + if (step === +1 && other.prop === unprefixed) { + if (!Browsers.withPrefix(other.value)) { + break; + } + } + } + + index += step; + } + return false; + }; + + return { + up: function up(callback) { + return checker(-1, callback); + }, + down: function down(callback) { + return checker(+1, callback); + } + }; + }; + + return Prefixes; +}(); + +module.exports = Prefixes; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/processor.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/processor.js new file mode 100644 index 00000000..93b424dc --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/processor.js @@ -0,0 +1,438 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Value = require('./value'); + +var OLD_LINEAR = /(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i; +var OLD_RADIAL = /(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i; + +var SIZES = ['width', 'height', 'min-width', 'max-width', 'min-height', 'max-height', 'inline-size', 'min-inline-size', 'max-inline-size', 'block-size', 'min-block-size', 'max-block-size']; + +var Processor = function () { + function Processor(prefixes) { + _classCallCheck(this, Processor); + + this.prefixes = prefixes; + } + + /** + * Add necessary prefixes + */ + + + Processor.prototype.add = function add(css, result) { + var _this = this; + + // At-rules + var resolution = this.prefixes.add['@resolution']; + var keyframes = this.prefixes.add['@keyframes']; + var viewport = this.prefixes.add['@viewport']; + var supports = this.prefixes.add['@supports']; + + css.walkAtRules(function (rule) { + if (rule.name === 'keyframes') { + if (!_this.disabled(rule, result)) { + return keyframes && keyframes.process(rule); + } + } else if (rule.name === 'viewport') { + if (!_this.disabled(rule, result)) { + return viewport && viewport.process(rule); + } + } else if (rule.name === 'supports') { + if (_this.prefixes.options.supports !== false && !_this.disabled(rule, result)) { + return supports.process(rule); + } + } else if (rule.name === 'media' && rule.params.indexOf('-resolution') !== -1) { + if (!_this.disabled(rule, result)) { + return resolution && resolution.process(rule); + } + } + + return undefined; + }); + + // Selectors + css.walkRules(function (rule) { + if (_this.disabled(rule, result)) return undefined; + + return _this.prefixes.add.selectors.map(function (selector) { + return selector.process(rule, result); + }); + }); + + css.walkDecls(function (decl) { + if (_this.disabledDecl(decl, result)) return undefined; + + if (decl.prop === 'display' && decl.value === 'box') { + result.warn('You should write display: flex by final spec ' + 'instead of display: box', { node: decl }); + return undefined; + } + if (decl.value.indexOf('linear-gradient') !== -1) { + if (OLD_LINEAR.test(decl.value)) { + result.warn('Gradient has outdated direction syntax. ' + 'New syntax is like `to left` instead of `right`.', { node: decl }); + } + } + if (decl.value.indexOf('radial-gradient') !== -1) { + if (OLD_RADIAL.test(decl.value)) { + result.warn('Gradient has outdated direction syntax. ' + 'New syntax is like `closest-side at 0 0` ' + 'instead of `0 0, closest-side`.', { node: decl }); + } else if (/[^-]cover/.test(decl.value)) { + result.warn('Gradient has outdated direction syntax. ' + 'Replace `cover` to `farthest-corner`.', { node: decl }); + } else if (/[^-]contain/.test(decl.value)) { + result.warn('Gradient has outdated direction syntax. ' + 'Replace `contain` to `closest-side`.', { node: decl }); + } + } + if (decl.prop === 'text-emphasis-position') { + if (decl.value === 'under' || decl.value === 'over') { + result.warn('You should use 2 values for text-emphasis-position ' + 'For example, `under left` instead of just `under`.', { node: decl }); + } + } + + if (SIZES.indexOf(decl.prop) !== -1) { + if (decl.value.indexOf('fill-available') !== -1) { + result.warn('Replace fill-available to stretch, ' + 'because spec had been changed', { node: decl }); + } else if (decl.value.indexOf('fill') !== -1) { + result.warn('Replace fill to stretch, ' + 'because spec had been changed', { node: decl }); + } + } + + var prefixer = void 0; + + if (decl.prop === 'transition' || decl.prop === 'transition-property') { + // Transition + return _this.prefixes.transition.add(decl, result); + } else if (decl.prop === 'align-self') { + // align-self flexbox or grid + var display = _this.displayType(decl); + if (display !== 'grid' && _this.prefixes.options.flexbox !== false) { + prefixer = _this.prefixes.add['align-self']; + if (prefixer && prefixer.prefixes) { + prefixer.process(decl); + } + } + if (display !== 'flex' && _this.prefixes.options.grid !== false) { + prefixer = _this.prefixes.add['grid-row-align']; + if (prefixer && prefixer.prefixes) { + return prefixer.process(decl, result); + } + } + } else if (decl.prop === 'justify-self') { + // justify-self flexbox or grid + var _display = _this.displayType(decl); + if (_display !== 'flex' && _this.prefixes.options.grid !== false) { + prefixer = _this.prefixes.add['grid-column-align']; + if (prefixer && prefixer.prefixes) { + return prefixer.process(decl, result); + } + } + } else { + // Properties + prefixer = _this.prefixes.add[decl.prop]; + if (prefixer && prefixer.prefixes) { + return prefixer.process(decl, result); + } + } + + return undefined; + }); + + // Values + return css.walkDecls(function (decl) { + if (_this.disabledValue(decl, result)) return; + + var unprefixed = _this.prefixes.unprefixed(decl.prop); + for (var _iterator = _this.prefixes.values('add', unprefixed), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var value = _ref; + + value.process(decl, result); + } + Value.save(_this.prefixes, decl); + }); + }; + + /** + * Remove unnecessary pefixes + */ + + + Processor.prototype.remove = function remove(css, result) { + var _this2 = this; + + // At-rules + var resolution = this.prefixes.remove['@resolution']; + + css.walkAtRules(function (rule, i) { + if (_this2.prefixes.remove['@' + rule.name]) { + if (!_this2.disabled(rule, result)) { + rule.parent.removeChild(i); + } + } else if (rule.name === 'media' && rule.params.indexOf('-resolution') !== -1 && resolution) { + resolution.clean(rule); + } + }); + + // Selectors + + var _loop = function _loop(checker) { + css.walkRules(function (rule, i) { + if (checker.check(rule)) { + if (!_this2.disabled(rule, result)) { + rule.parent.removeChild(i); + } + } + }); + }; + + for (var _iterator2 = this.prefixes.remove.selectors, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var checker = _ref2; + + _loop(checker); + } + + return css.walkDecls(function (decl, i) { + if (_this2.disabled(decl, result)) return; + + var rule = decl.parent; + var unprefixed = _this2.prefixes.unprefixed(decl.prop); + + // Transition + if (decl.prop === 'transition' || decl.prop === 'transition-property') { + _this2.prefixes.transition.remove(decl); + } + + // Properties + if (_this2.prefixes.remove[decl.prop] && _this2.prefixes.remove[decl.prop].remove) { + var notHack = _this2.prefixes.group(decl).down(function (other) { + return _this2.prefixes.normalize(other.prop) === unprefixed; + }); + + if (unprefixed === 'flex-flow') { + notHack = true; + } + + if (notHack && !_this2.withHackValue(decl)) { + if (decl.raw('before').indexOf('\n') > -1) { + _this2.reduceSpaces(decl); + } + rule.removeChild(i); + return; + } + } + + // Values + for (var _iterator3 = _this2.prefixes.values('remove', unprefixed), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var checker = _ref3; + + if (!checker.check(decl.value)) { + continue; + } + + unprefixed = checker.unprefixed; + var _notHack = _this2.prefixes.group(decl).down(function (other) { + return other.value.indexOf(unprefixed) !== -1; + }); + + if (_notHack) { + rule.removeChild(i); + return; + } + } + }); + }; + + /** + * Some rare old values, which is not in standard + */ + + + Processor.prototype.withHackValue = function withHackValue(decl) { + return decl.prop === '-webkit-background-clip' && decl.value === 'text'; + }; + + /** + * Check for grid/flexbox options. + */ + + + Processor.prototype.disabledValue = function disabledValue(node, result) { + if (this.prefixes.options.grid === false && node.type === 'decl') { + if (node.prop === 'display' && node.value.indexOf('grid') !== -1) { + return true; + } + } + if (this.prefixes.options.flexbox === false && node.type === 'decl') { + if (node.prop === 'display' && node.value.indexOf('flex') !== -1) { + return true; + } + } + + return this.disabled(node, result); + }; + + /** + * Check for grid/flexbox options. + */ + + + Processor.prototype.disabledDecl = function disabledDecl(node, result) { + if (this.prefixes.options.grid === false && node.type === 'decl') { + if (node.prop.indexOf('grid') !== -1 || node.prop === 'justify-items') { + return true; + } + } + if (this.prefixes.options.flexbox === false && node.type === 'decl') { + var other = ['order', 'justify-content', 'align-items', 'align-content']; + if (node.prop.indexOf('flex') !== -1 || other.indexOf(node.prop) !== -1) { + return true; + } + } + + return this.disabled(node, result); + }; + + /** + * Check for control comment and global options + */ + + + Processor.prototype.disabled = function disabled(node, result) { + if (!node) return false; + if (node._autoprefixerDisabled !== undefined) { + return node._autoprefixerDisabled; + } + + if (node.nodes) { + var status = undefined; + node.each(function (i) { + if (i.type !== 'comment') return; + if (/(!\s*)?autoprefixer:\s*(off|on)/i.test(i.text)) { + if (typeof status !== 'undefined') { + result.warn('Second Autoprefixer control comment ' + 'was ignored. Autoprefixer applies control ' + 'comment to whole block, not to next rules.', { node: i }); + } else { + status = /on/i.test(i.text); + } + } + }); + + var value = false; + if (status !== undefined) { + value = !status; + } else if (node.parent) { + value = this.disabled(node.parent, result); + } + + node._autoprefixerDisabled = value; + return node._autoprefixerDisabled; + } else { + node._autoprefixerDisabled = this.disabled(node.parent, result); + return node._autoprefixerDisabled; + } + }; + + /** + * Normalize spaces in cascade declaration group + */ + + + Processor.prototype.reduceSpaces = function reduceSpaces(decl) { + var stop = false; + this.prefixes.group(decl).up(function () { + stop = true; + return true; + }); + if (stop) { + return; + } + + var parts = decl.raw('before').split('\n'); + var prevMin = parts[parts.length - 1].length; + var diff = false; + + this.prefixes.group(decl).down(function (other) { + parts = other.raw('before').split('\n'); + var last = parts.length - 1; + + if (parts[last].length > prevMin) { + if (diff === false) { + diff = parts[last].length - prevMin; + } + + parts[last] = parts[last].slice(0, -diff); + other.raws.before = parts.join('\n'); + } + }); + }; + + /** + * Is it flebox or grid rule + */ + + + Processor.prototype.displayType = function displayType(decl) { + for (var _iterator4 = decl.parent.nodes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var i = _ref4; + + if (i.prop !== 'display') { + continue; + } + + if (i.value.indexOf('flex') !== -1) { + return 'flex'; + } + + if (i.value.indexOf('grid') !== -1) { + return 'grid'; + } + } + + return false; + }; + + return Processor; +}(); + +module.exports = Processor; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/resolution.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/resolution.js new file mode 100644 index 00000000..dd6c35c3 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/resolution.js @@ -0,0 +1,154 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Prefixer = require('./prefixer'); +var utils = require('./utils'); + +var n2f = require('num2fraction'); + +var regexp = /(min|max)-resolution\s*:\s*\d*\.?\d+(dppx|dpi)/gi; +var split = /(min|max)-resolution(\s*:\s*)(\d*\.?\d+)(dppx|dpi)/i; + +var Resolution = function (_Prefixer) { + _inherits(Resolution, _Prefixer); + + function Resolution() { + _classCallCheck(this, Resolution); + + return _possibleConstructorReturn(this, _Prefixer.apply(this, arguments)); + } + + /** + * Return prefixed query name + */ + Resolution.prototype.prefixName = function prefixName(prefix, name) { + var newName = prefix === '-moz-' ? name + '--moz-device-pixel-ratio' : prefix + name + '-device-pixel-ratio'; + return newName; + }; + + /** + * Return prefixed query + */ + + + Resolution.prototype.prefixQuery = function prefixQuery(prefix, name, colon, value, units) { + if (units === 'dpi') { + value = Number(value / 96); + } + if (prefix === '-o-') { + value = n2f(value); + } + return this.prefixName(prefix, name) + colon + value; + }; + + /** + * Remove prefixed queries + */ + + + Resolution.prototype.clean = function clean(rule) { + var _this2 = this; + + if (!this.bad) { + this.bad = []; + for (var _iterator = this.prefixes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var prefix = _ref; + + this.bad.push(this.prefixName(prefix, 'min')); + this.bad.push(this.prefixName(prefix, 'max')); + } + } + + rule.params = utils.editList(rule.params, function (queries) { + return queries.filter(function (query) { + return _this2.bad.every(function (i) { + return query.indexOf(i) === -1; + }); + }); + }); + }; + + /** + * Add prefixed queries + */ + + + Resolution.prototype.process = function process(rule) { + var _this3 = this; + + var parent = this.parentPrefix(rule); + var prefixes = parent ? [parent] : this.prefixes; + + rule.params = utils.editList(rule.params, function (origin, prefixed) { + for (var _iterator2 = origin, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var query = _ref2; + + if (query.indexOf('min-resolution') === -1 && query.indexOf('max-resolution') === -1) { + prefixed.push(query); + continue; + } + + var _loop = function _loop(prefix) { + var processed = query.replace(regexp, function (str) { + var parts = str.match(split); + return _this3.prefixQuery(prefix, parts[1], parts[2], parts[3], parts[4]); + }); + prefixed.push(processed); + }; + + for (var _iterator3 = prefixes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var prefix = _ref3; + + _loop(prefix); + } + prefixed.push(query); + } + + return utils.uniq(prefixed); + }); + }; + + return Resolution; +}(Prefixer); + +module.exports = Resolution; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/selector.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/selector.js new file mode 100644 index 00000000..08bbb55d --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/selector.js @@ -0,0 +1,180 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var OldSelector = require('./old-selector'); +var Prefixer = require('./prefixer'); +var Browsers = require('./browsers'); +var utils = require('./utils'); + +var Selector = function (_Prefixer) { + _inherits(Selector, _Prefixer); + + function Selector(name, prefixes, all) { + _classCallCheck(this, Selector); + + var _this = _possibleConstructorReturn(this, _Prefixer.call(this, name, prefixes, all)); + + _this.regexpCache = {}; + return _this; + } + + /** + * Is rule selectors need to be prefixed + */ + + + Selector.prototype.check = function check(rule) { + if (rule.selector.indexOf(this.name) !== -1) { + return !!rule.selector.match(this.regexp()); + } + + return false; + }; + + /** + * Return prefixed version of selector + */ + + + Selector.prototype.prefixed = function prefixed(prefix) { + return this.name.replace(/^([^\w]*)/, '$1' + prefix); + }; + + /** + * Lazy loadRegExp for name + */ + + + Selector.prototype.regexp = function regexp(prefix) { + if (this.regexpCache[prefix]) { + return this.regexpCache[prefix]; + } + + var name = prefix ? this.prefixed(prefix) : this.name; + this.regexpCache[prefix] = new RegExp('(^|[^:"\'=])' + utils.escapeRegexp(name), 'gi'); + return this.regexpCache[prefix]; + }; + + /** + * All possible prefixes + */ + + + Selector.prototype.possible = function possible() { + return Browsers.prefixes(); + }; + + /** + * Return all possible selector prefixes + */ + + + Selector.prototype.prefixeds = function prefixeds(rule) { + if (rule._autoprefixerPrefixeds) { + return rule._autoprefixerPrefixeds; + } + + var prefixeds = {}; + for (var _iterator = this.possible(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var prefix = _ref; + + prefixeds[prefix] = this.replace(rule.selector, prefix); + } + + rule._autoprefixerPrefixeds = prefixeds; + return rule._autoprefixerPrefixeds; + }; + + /** + * Is rule already prefixed before + */ + + + Selector.prototype.already = function already(rule, prefixeds, prefix) { + var index = rule.parent.index(rule) - 1; + + while (index >= 0) { + var before = rule.parent.nodes[index]; + + if (before.type !== 'rule') { + return false; + } + + var some = false; + for (var key in prefixeds) { + var prefixed = prefixeds[key]; + if (before.selector === prefixed) { + if (prefix === key) { + return true; + } else { + some = true; + break; + } + } + } + if (!some) { + return false; + } + + index -= 1; + } + + return false; + }; + + /** + * Replace selectors by prefixed one + */ + + + Selector.prototype.replace = function replace(selector, prefix) { + return selector.replace(this.regexp(), '$1' + this.prefixed(prefix)); + }; + + /** + * Clone and add prefixes for at-rule + */ + + + Selector.prototype.add = function add(rule, prefix) { + var prefixeds = this.prefixeds(rule); + + if (this.already(rule, prefixeds, prefix)) { + return; + } + + var cloned = this.clone(rule, { selector: prefixeds[prefix] }); + rule.parent.insertBefore(rule, cloned); + }; + + /** + * Return function to fast find prefixed selector + */ + + + Selector.prototype.old = function old(prefix) { + return new OldSelector(this, prefix); + }; + + return Selector; +}(Prefixer); + +module.exports = Selector; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/supports.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/supports.js new file mode 100644 index 00000000..e4224d3e --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/supports.js @@ -0,0 +1,380 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Browsers = require('./browsers'); +var brackets = require('./brackets'); +var Value = require('./value'); +var utils = require('./utils'); + +var postcss = require('postcss'); + +var supported = []; +var data = require('caniuse-lite').feature(require('caniuse-lite/data/features/css-featurequeries.js')); +for (var browser in data.stats) { + var versions = data.stats[browser]; + for (var version in versions) { + var support = versions[version]; + if (/y/.test(support)) { + supported.push(browser + ' ' + version); + } + } +} + +var Supports = function () { + function Supports(Prefixes, all) { + _classCallCheck(this, Supports); + + this.Prefixes = Prefixes; + this.all = all; + } + + /** + * Return prefixer only with @supports supported browsers + */ + + + Supports.prototype.prefixer = function prefixer() { + if (this.prefixerCache) { + return this.prefixerCache; + } + + var filtered = this.all.browsers.selected.filter(function (i) { + return supported.indexOf(i) !== -1; + }); + + var browsers = new Browsers(this.all.browsers.data, filtered, this.all.options); + this.prefixerCache = new this.Prefixes(this.all.data, browsers, this.all.options); + return this.prefixerCache; + }; + + /** + * Parse string into declaration property and value + */ + + + Supports.prototype.parse = function parse(str) { + var _str$split = str.split(':'), + prop = _str$split[0], + value = _str$split[1]; + + if (!value) value = ''; + return [prop.trim(), value.trim()]; + }; + + /** + * Create virtual rule to process it by prefixer + */ + + + Supports.prototype.virtual = function virtual(str) { + var _parse = this.parse(str), + prop = _parse[0], + value = _parse[1]; + + var rule = postcss.parse('a{}').first; + rule.append({ prop: prop, value: value, raws: { before: '' } }); + return rule; + }; + + /** + * Return array of Declaration with all necessary prefixes + */ + + + Supports.prototype.prefixed = function prefixed(str) { + var rule = this.virtual(str); + if (this.disabled(rule.first)) { + return rule.nodes; + } + + var prefixer = this.prefixer().add[rule.first.prop]; + prefixer && prefixer.process && prefixer.process(rule.first); + + for (var _iterator = rule.nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var decl = _ref; + + for (var _iterator2 = this.prefixer().values('add', rule.first.prop), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var value = _ref2; + + value.process(decl); + } + Value.save(this.all, decl); + } + + return rule.nodes; + }; + + /** + * Return true if brackets node is "not" word + */ + + + Supports.prototype.isNot = function isNot(node) { + return typeof node === 'string' && /not\s*/i.test(node); + }; + + /** + * Return true if brackets node is "or" word + */ + + + Supports.prototype.isOr = function isOr(node) { + return typeof node === 'string' && /\s*or\s*/i.test(node); + }; + + /** + * Return true if brackets node is (prop: value) + */ + + + Supports.prototype.isProp = function isProp(node) { + return (typeof node === 'undefined' ? 'undefined' : _typeof(node)) === 'object' && node.length === 1 && typeof node[0] === 'string'; + }; + + /** + * Return true if prefixed property has no unprefixed + */ + + + Supports.prototype.isHack = function isHack(all, unprefixed) { + var check = new RegExp('(\\(|\\s)' + utils.escapeRegexp(unprefixed) + ':'); + return !check.test(all); + }; + + /** + * Return true if we need to remove node + */ + + + Supports.prototype.toRemove = function toRemove(str, all) { + var _parse2 = this.parse(str), + prop = _parse2[0], + value = _parse2[1]; + + var unprefixed = this.all.unprefixed(prop); + + var cleaner = this.all.cleaner(); + + if (cleaner.remove[prop] && cleaner.remove[prop].remove && !this.isHack(all, unprefixed)) { + return true; + } + + for (var _iterator3 = cleaner.values('remove', unprefixed), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var checker = _ref3; + + if (checker.check(value)) { + return true; + } + } + + return false; + }; + + /** + * Remove all unnecessary prefixes + */ + + + Supports.prototype.remove = function remove(nodes, all) { + var i = 0; + while (i < nodes.length) { + if (!this.isNot(nodes[i - 1]) && this.isProp(nodes[i]) && this.isOr(nodes[i + 1])) { + if (this.toRemove(nodes[i][0], all)) { + nodes.splice(i, 2); + continue; + } + + i += 2; + continue; + } + + if (_typeof(nodes[i]) === 'object') { + nodes[i] = this.remove(nodes[i], all); + } + + i += 1; + } + return nodes; + }; + + /** + * Clean brackets with one child + */ + + + Supports.prototype.cleanBrackets = function cleanBrackets(nodes) { + var _this = this; + + return nodes.map(function (i) { + if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) !== 'object') { + return i; + } + + if (i.length === 1 && _typeof(i[0]) === 'object') { + return _this.cleanBrackets(i[0]); + } + + return _this.cleanBrackets(i); + }); + }; + + /** + * Add " or " between properties and convert it to brackets format + */ + + + Supports.prototype.convert = function convert(progress) { + var result = ['']; + for (var _iterator4 = progress, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var i = _ref4; + + result.push([i.prop + ': ' + i.value]); + result.push(' or '); + } + result[result.length - 1] = ''; + return result; + }; + + /** + * Compress value functions into a string nodes + */ + + + Supports.prototype.normalize = function normalize(nodes) { + var _this2 = this; + + if ((typeof nodes === 'undefined' ? 'undefined' : _typeof(nodes)) !== 'object') { + return nodes; + } + + nodes = nodes.filter(function (i) { + return i !== ''; + }); + if (typeof nodes[0] === 'string' && nodes[0].indexOf(':') !== -1) { + return [brackets.stringify(nodes)]; + } + + return nodes.map(function (i) { + return _this2.normalize(i); + }); + }; + + /** + * Add prefixes + */ + + + Supports.prototype.add = function add(nodes, all) { + var _this3 = this; + + return nodes.map(function (i) { + if (_this3.isProp(i)) { + var prefixed = _this3.prefixed(i[0]); + if (prefixed.length > 1) { + return _this3.convert(prefixed); + } + + return i; + } + + if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object') { + return _this3.add(i, all); + } + + return i; + }); + }; + + /** + * Add prefixed declaration + */ + + + Supports.prototype.process = function process(rule) { + var ast = brackets.parse(rule.params); + ast = this.normalize(ast); + ast = this.remove(ast, rule.params); + ast = this.add(ast, rule.params); + ast = this.cleanBrackets(ast); + rule.params = brackets.stringify(ast); + }; + + /** + * Check global options + */ + + + Supports.prototype.disabled = function disabled(node) { + if (!this.all.options.grid) { + if (node.prop === 'display' && node.value.indexOf('grid') !== -1) { + return true; + } + if (node.prop.indexOf('grid') !== -1 || node.prop === 'justify-items') { + return true; + } + } + + if (this.all.options.flexbox === false) { + if (node.prop === 'display' && node.value.indexOf('flex') !== -1) { + return true; + } + var other = ['order', 'justify-content', 'align-items', 'align-content']; + if (node.prop.indexOf('flex') !== -1 || other.indexOf(node.prop) !== -1) { + return true; + } + } + + return false; + }; + + return Supports; +}(); + +module.exports = Supports; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/transition.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/transition.js new file mode 100644 index 00000000..e29a542a --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/transition.js @@ -0,0 +1,446 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var parser = require('postcss-value-parser'); +var vendor = require('postcss').vendor; +var list = require('postcss').list; + +var Transition = function () { + function Transition(prefixes) { + _classCallCheck(this, Transition); + + Object.defineProperty(this, 'props', { + enumerable: true, + writable: true, + value: ['transition', 'transition-property'] + }); + + this.prefixes = prefixes; + } + + /** + * Process transition and add prefies for all necessary properties + */ + + + Transition.prototype.add = function add(decl, result) { + var _this = this; + + var prefix = void 0, + prop = void 0; + var declPrefixes = this.prefixes.add[decl.prop] && this.prefixes.add[decl.prop].prefixes || []; + + var params = this.parse(decl.value); + var names = params.map(function (i) { + return _this.findProp(i); + }); + var added = []; + + if (names.some(function (i) { + return i[0] === '-'; + })) { + return; + } + + for (var _iterator = params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var param = _ref; + + prop = this.findProp(param); + if (prop[0] === '-') continue; + + var prefixer = this.prefixes.add[prop]; + if (!prefixer || !prefixer.prefixes) continue; + + for (var _iterator3 = prefixer.prefixes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + prefix = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + prefix = _i3.value; + } + + var prefixed = this.prefixes.prefixed(prop, prefix); + if (prefixed !== '-ms-transform' && names.indexOf(prefixed) === -1) { + if (!this.disabled(prop, prefix)) { + added.push(this.clone(prop, prefixed, param)); + } + } + } + } + + params = params.concat(added); + var value = this.stringify(params); + + var webkitClean = this.stringify(this.cleanFromUnprefixed(params, '-webkit-')); + if (declPrefixes.indexOf('-webkit-') !== -1) { + this.cloneBefore(decl, '-webkit-' + decl.prop, webkitClean); + } + this.cloneBefore(decl, decl.prop, webkitClean); + if (declPrefixes.indexOf('-o-') !== -1) { + var operaClean = this.stringify(this.cleanFromUnprefixed(params, '-o-')); + this.cloneBefore(decl, '-o-' + decl.prop, operaClean); + } + + for (var _iterator2 = declPrefixes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + prefix = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + prefix = _i2.value; + } + + if (prefix !== '-webkit-' && prefix !== '-o-') { + var prefixValue = this.stringify(this.cleanOtherPrefixes(params, prefix)); + this.cloneBefore(decl, prefix + decl.prop, prefixValue); + } + } + + if (value !== decl.value && !this.already(decl, decl.prop, value)) { + this.checkForWarning(result, decl); + decl.cloneBefore(); + decl.value = value; + } + }; + + /** + * Find property name + */ + + + Transition.prototype.findProp = function findProp(param) { + var prop = param[0].value; + if (/^\d/.test(prop)) { + for (var i = 0; i < param.length; i++) { + var token = param[i]; + if (i !== 0 && token.type === 'word') { + return token.value; + } + } + } + return prop; + }; + + /** + * Does we aready have this declaration + */ + + + Transition.prototype.already = function already(decl, prop, value) { + return decl.parent.some(function (i) { + return i.prop === prop && i.value === value; + }); + }; + + /** + * Add declaration if it is not exist + */ + + + Transition.prototype.cloneBefore = function cloneBefore(decl, prop, value) { + if (!this.already(decl, prop, value)) { + decl.cloneBefore({ prop: prop, value: value }); + } + }; + + /** + * Show transition-property warning + */ + + + Transition.prototype.checkForWarning = function checkForWarning(result, decl) { + if (decl.prop !== 'transition-property') { + return; + } + + decl.parent.each(function (i) { + if (i.type !== 'decl') { + return undefined; + } + if (i.prop.indexOf('transition-') !== 0) { + return undefined; + } + if (i.prop === 'transition-property') { + return undefined; + } + + if (list.comma(i.value).length > 1) { + decl.warn(result, 'Replace transition-property to transition, ' + 'because Autoprefixer could not support ' + 'any cases of transition-property ' + 'and other transition-*'); + } + return false; + }); + }; + + /** + * Process transition and remove all unnecessary properties + */ + + + Transition.prototype.remove = function remove(decl) { + var _this2 = this; + + var params = this.parse(decl.value); + params = params.filter(function (i) { + var prop = _this2.prefixes.remove[_this2.findProp(i)]; + return !prop || !prop.remove; + }); + var value = this.stringify(params); + + if (decl.value === value) { + return; + } + + if (params.length === 0) { + decl.remove(); + return; + } + + var double = decl.parent.some(function (i) { + return i.prop === decl.prop && i.value === value; + }); + var smaller = decl.parent.some(function (i) { + return i !== decl && i.prop === decl.prop && i.value.length > value.length; + }); + + if (double || smaller) { + decl.remove(); + return; + } + + decl.value = value; + }; + + /** + * Parse properties list to array + */ + + + Transition.prototype.parse = function parse(value) { + var ast = parser(value); + var result = []; + var param = []; + for (var _iterator4 = ast.nodes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref2; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref2 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref2 = _i4.value; + } + + var node = _ref2; + + param.push(node); + if (node.type === 'div' && node.value === ',') { + result.push(param); + param = []; + } + } + result.push(param); + return result.filter(function (i) { + return i.length > 0; + }); + }; + + /** + * Return properties string from array + */ + + + Transition.prototype.stringify = function stringify(params) { + if (params.length === 0) { + return ''; + } + var nodes = []; + for (var _iterator5 = params, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref3; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref3 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref3 = _i5.value; + } + + var param = _ref3; + + if (param[param.length - 1].type !== 'div') { + param.push(this.div(params)); + } + nodes = nodes.concat(param); + } + if (nodes[0].type === 'div') { + nodes = nodes.slice(1); + } + if (nodes[nodes.length - 1].type === 'div') { + nodes = nodes.slice(0, +-2 + 1 || undefined); + } + return parser.stringify({ nodes: nodes }); + }; + + /** + * Return new param array with different name + */ + + + Transition.prototype.clone = function clone(origin, name, param) { + var result = []; + var changed = false; + for (var _iterator6 = param, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref4; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref4 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref4 = _i6.value; + } + + var i = _ref4; + + if (!changed && i.type === 'word' && i.value === origin) { + result.push({ type: 'word', value: name }); + changed = true; + } else { + result.push(i); + } + } + return result; + }; + + /** + * Find or create seperator + */ + + + Transition.prototype.div = function div(params) { + for (var _iterator7 = params, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref5; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref5 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref5 = _i7.value; + } + + var param = _ref5; + + for (var _iterator8 = param, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { + var _ref6; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref6 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref6 = _i8.value; + } + + var node = _ref6; + + if (node.type === 'div' && node.value === ',') { + return node; + } + } + } + return { type: 'div', value: ',', after: ' ' }; + }; + + Transition.prototype.cleanOtherPrefixes = function cleanOtherPrefixes(params, prefix) { + var _this3 = this; + + return params.filter(function (param) { + var current = vendor.prefix(_this3.findProp(param)); + return current === '' || current === prefix; + }); + }; + + /** + * Remove all non-webkit prefixes and unprefixed params if we have prefixed + */ + + + Transition.prototype.cleanFromUnprefixed = function cleanFromUnprefixed(params, prefix) { + var _this4 = this; + + var remove = params.map(function (i) { + return _this4.findProp(i); + }).filter(function (i) { + return i.slice(0, prefix.length) === prefix; + }).map(function (i) { + return _this4.prefixes.unprefixed(i); + }); + + var result = []; + for (var _iterator9 = params, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref7; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref7 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref7 = _i9.value; + } + + var param = _ref7; + + var prop = this.findProp(param); + var p = vendor.prefix(prop); + if (remove.indexOf(prop) === -1 && (p === prefix || p === '')) { + result.push(param); + } + } + return result; + }; + + /** + * Check property for disabled by option + */ + + + Transition.prototype.disabled = function disabled(prop, prefix) { + var other = ['order', 'justify-content', 'align-self', 'align-content']; + if (prop.indexOf('flex') !== -1 || other.indexOf(prop) !== -1) { + if (this.prefixes.options.flexbox === false) { + return true; + } + + if (this.prefixes.options.flexbox === 'no-2009') { + return prefix.indexOf('2009') !== -1; + } + } + return undefined; + }; + + return Transition; +}(); + +module.exports = Transition; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/utils.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/utils.js new file mode 100644 index 00000000..5b4b5620 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/utils.js @@ -0,0 +1,93 @@ +'use strict'; + +var list = require('postcss').list; + +module.exports = { + + /** + * Throw special error, to tell beniary, + * that this error is from Autoprefixer. + */ + error: function error(text) { + var err = new Error(text); + err.autoprefixer = true; + throw err; + }, + + + /** + * Return array, that doesn’t contain duplicates. + */ + uniq: function uniq(array) { + var filtered = []; + for (var _iterator = array, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var i = _ref; + + if (filtered.indexOf(i) === -1) { + filtered.push(i); + } + } + return filtered; + }, + + + /** + * Return "-webkit-" on "-webkit- old" + */ + removeNote: function removeNote(string) { + if (string.indexOf(' ') === -1) { + return string; + } + + return string.split(' ')[0]; + }, + + + /** + * Escape RegExp symbols + */ + escapeRegexp: function escapeRegexp(string) { + return string.replace(/[.?*+\^\$\[\]\\(){}|\-]/g, '\\$&'); + }, + + + /** + * Return regexp to check, that CSS string contain word + */ + regexp: function regexp(word) { + var escape = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + if (escape) { + word = this.escapeRegexp(word); + } + return new RegExp('(^|[\\s,(])(' + word + '($|[\\s(,]))', 'gi'); + }, + + + /** + * Change comma list + */ + editList: function editList(value, callback) { + var origin = list.comma(value); + var changed = callback(origin, []); + + if (origin === changed) { + return value; + } + + var join = value.match(/,\s*/); + join = join ? join[0] : ', '; + return changed.join(join); + } +}; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/lib/value.js b/node_modules/rucksack-css/node_modules/autoprefixer/lib/value.js new file mode 100644 index 00000000..b1d1b8f2 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/lib/value.js @@ -0,0 +1,168 @@ +'use strict'; + +function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } + +var Prefixer = require('./prefixer'); +var OldValue = require('./old-value'); +var utils = require('./utils'); + +var vendor = require('postcss').vendor; + +var Value = function (_Prefixer) { + _inherits(Value, _Prefixer); + + function Value() { + _classCallCheck(this, Value); + + return _possibleConstructorReturn(this, _Prefixer.apply(this, arguments)); + } + + /** + * Clone decl for each prefixed values + */ + Value.save = function save(prefixes, decl) { + var _this2 = this; + + var prop = decl.prop; + var result = []; + + var _loop = function _loop(prefix) { + var value = decl._autoprefixerValues[prefix]; + + if (value === decl.value) { + return 'continue'; + } + + var item = void 0; + var propPrefix = vendor.prefix(prop); + + if (propPrefix === '-pie-') { + return 'continue'; + } + + if (propPrefix === prefix) { + item = decl.value = value; + result.push(item); + return 'continue'; + } + + var prefixed = prefixes.prefixed(prop, prefix); + var rule = decl.parent; + + if (!rule.every(function (i) { + return i.prop !== prefixed; + })) { + result.push(item); + return 'continue'; + } + + var trimmed = value.replace(/\s+/, ' '); + var already = rule.some(function (i) { + return i.prop === decl.prop && i.value.replace(/\s+/, ' ') === trimmed; + }); + + if (already) { + result.push(item); + return 'continue'; + } + + var cloned = _this2.clone(decl, { value: value }); + item = decl.parent.insertBefore(decl, cloned); + + result.push(item); + }; + + for (var prefix in decl._autoprefixerValues) { + var _ret = _loop(prefix); + + if (_ret === 'continue') continue; + } + + return result; + }; + + /** + * Is declaration need to be prefixed + */ + + + Value.prototype.check = function check(decl) { + var value = decl.value; + if (value.indexOf(this.name) === -1) { + return false; + } + + return !!value.match(this.regexp()); + }; + + /** + * Lazy regexp loading + */ + + + Value.prototype.regexp = function regexp() { + return this.regexpCache || (this.regexpCache = utils.regexp(this.name)); + }; + + /** + * Add prefix to values in string + */ + + + Value.prototype.replace = function replace(string, prefix) { + return string.replace(this.regexp(), '$1' + prefix + '$2'); + }; + + /** + * Get value with comments if it was not changed + */ + + + Value.prototype.value = function value(decl) { + if (decl.raws.value && decl.raws.value.value === decl.value) { + return decl.raws.value.raw; + } else { + return decl.value; + } + }; + + /** + * Save values with next prefixed token + */ + + + Value.prototype.add = function add(decl, prefix) { + if (!decl._autoprefixerValues) { + decl._autoprefixerValues = {}; + } + var value = decl._autoprefixerValues[prefix] || this.value(decl); + + var before = void 0; + do { + before = value; + value = this.replace(value, prefix); + if (value === false) return; + } while (value !== before); + + decl._autoprefixerValues[prefix] = value; + }; + + /** + * Return function to fast find prefixed value + */ + + + Value.prototype.old = function old(prefix) { + return new OldValue(this.name, prefix + this.name); + }; + + return Value; +}(Prefixer); + +module.exports = Value; \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/autoprefixer/package.json b/node_modules/rucksack-css/node_modules/autoprefixer/package.json new file mode 100644 index 00000000..e59fc743 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/autoprefixer/package.json @@ -0,0 +1,27 @@ +{ + "name": "autoprefixer", + "version": "7.2.6", + "description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website", + "keywords": [ + "autoprefixer", + "css", + "prefix", + "postcss", + "postcss-plugin" + ], + "author": "Andrey Sitnik ", + "license": "MIT", + "repository": "postcss/autoprefixer", + "dependencies": { + "browserslist": "^2.11.3", + "caniuse-lite": "^1.0.30000805", + "normalize-range": "^0.1.2", + "num2fraction": "^1.2.2", + "postcss": "^6.0.17", + "postcss-value-parser": "^3.2.3" + }, + "bin": { + "autoprefixer-info": "./bin/autoprefixer-info" + }, + "main": "lib/autoprefixer" +} \ No newline at end of file diff --git a/node_modules/rucksack-css/node_modules/browserslist/CHANGELOG.md b/node_modules/rucksack-css/node_modules/browserslist/CHANGELOG.md new file mode 100644 index 00000000..5fa322e6 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/browserslist/CHANGELOG.md @@ -0,0 +1,234 @@ +# Change Log +This project adheres to [Semantic Versioning](http://semver.org/). + +## 2.11.3 +* Fix for `path: undefined` option. + +## 2.11.2 +* Remove Node.js specific code from webpack build. + +## 2.11.1 +* Fix using Browserslist in browser with `path` but without `fs`. + +## 2.11 +* Add `last 2 years` query support (by James Harris). + +## 2.10.2 +* Fix Browserify support. + +## 2.10.1 +* Fix using Browserslist without `process` (by Andrew Patton). + +## 2.10 +* Add `< 1%` and `<= 1%` queries support (by August Kaiser). + +## 2.9.1 +* Fix unknown query on trailing spaces in query. + +## 2.9 +* Add `last Electron versions` and `last Electron major versions` queries + (by Louis Mouhat). + +## 2.8 +* Add `since 2016-03` and `since 2016-03-20` queries support (by Andrew Blick). + +## 2.7 +* Add `since 2016` queries support (by Igor Deryabin). + +## 2.6.1 +* Fix `Path must be a string` error. + +## 2.6 +* By default load config from current directory in CLI tool. + +## 2.5.1 +* Allow `@scope/browserlist-config` config name (by Jamie Connolly). + +## 2.5 +* Add `extends` query (by YellowKirby). + +## 2.4.1 +* Throw error if `package.json` contain `browserlist` instead of `browserslist`. + +## 2.4 +* Add `last n major versions` query (by John Sanders). + +## 2.3.3 +* Fix browsers support. + +## 2.3.2 +* Fix `> 0` query for browsers with one version (by Nikolay Solovyov). + +## 2.3.1 +* Reduce library size. + +## 2.3 +* Add `unreleased versions` and `unreleased Chrome versions` queries. + +## 2.2.2 +* Fix `Path must be a string` error (by Pieter Beulque). + +## 2.2.1 +* Fix security issue with regions dynamic `require`. + +## 2.2 +* Add region usage statistics support (by Clément P). + +## 2.1.5 +* Remove Firefox 45 from Firefox ESR. + +## 2.1.4 +* Use both ESR versions when they actual. + +## 2.1.3 +* Add warning on first exclude query. + +## 2.1.2 +* Fix non-Node.js environments support. + +## 2.1.1 +* Fix CLI arguments parsing. + +## 2.1 +* Add `>= 5%`, `>= 5% in US` and `>= 5% in my stats` queries. + +## 2.0 +* `last n versions` returns versions for all browsers, not only main browsers. +* Cache file system operations (by Aarni Koskela). +* Use `caniuse-lite` 1 MB instead of `caniuse-db` 7 MB (by Ben Briggs). +* Add `.browserslistrc` config support. +* Add QQ Browser for Android support. +* Add tests for CLI (by Zhulduz Zhankenova). + +## 1.7.7 +* Update Firefox ESR. + +## 1.7.6 +* Fix Android Chrome selection. + +## 1.7.5 +* Fix combining `not` query with country based statistics. +* Fix `--env` argument in CLI (by Tuure Savuoja). + +## 1.7.4 +* Speed up browser sorting (by Aarni Koskela). + +## 1.7.3 +* Fix config finding when directory was passed to `path` (by Aarni Koskela). + +## 1.7.2 +* Fix config finding algorithm (by Aarni Koskela). + +## 1.7.1 +* Fix unreleased browsers version detection. + +## 1.7 +* Add `--config` and `--env` arguments to CLI (by Jarek Rencz). + +## 1.6 +* Convert Electron version to Chrome (by Kilian Valkhof). +* Fix `0` version mistake in Can I Use data. + +## 1.5.2 +* Fix browser versions ordering (by Marco Massarotto). + +## 1.5.1 +* Fix error on `package.json` and `browserslist` in same directory. + +## 1.5 +* Add `package.json` support (by Stepan Kuzmin). +* Add environments support (by Maksim Semenov and openlibser). +* Add `browserslist-stats.json` file support (by Oleh Aloshkin). +* Add `config` option to CLI (by Evilebot Tnawi). +* Add JSDoc. +* Fix tests on Windows (by Anna Stoliar). +* Don’t set custom usage statistics globally. + +## 1.4 +* Add `defaults` keyword. + +## 1.3.6 +* Add `UCAndroid` alias to `and_uc` (by Evilebot Tnawi). + +## 1.3.5 +* Fix Opera Mini support. Use `op_mini all`. + +## 1.3.4 +* Add space-less `>1%` and `>.5%` syntax support (by Andreas Lind). + +## 1.3.3 +* Clean `0` versions in some country-based requests. + +## 1.3.2 +* Update Firefox ESR. + +## 1.3.1 +* Add Safari TP support. + +## 1.3 +* Add coverage for specific country (by Joshua Wise). + +## 1.2 +* Add `browserslist.coverage()` method. +* Add `--coverage` and `-c` argument to CLI. +* Add `-v` argument support to CLI. +* Better error handling in CLI. + +## 1.1.3 +* Fix jspm support (by Sean Anderson). + +## 1.1.2 +* Fix jspm support (by Sean Anderson). + +## 1.1.1 +* Fix space-less `>10%` and `>10% in my stats` queries. +* Normalize error messages. +* Remove development files from npm package. + +## 1.1 +* Added query against custom browser usage data (by Daniel Rey). + +## 1.0.1 +* Update Firefox ESR (by Rouven Weßling). + +## 1.0 +* Remove Opera 12.1 from default query. +* Add `not` keyword and exclude browsers by query. +* Add Microsoft Edge support (by Andrey Polischuk). +* Add CLI for debug and non-JS usage (by Luke Horvat). +* Use own class in Browserslist errors. + +## 0.5 +* Add version ranges `IE 6-9` (by Ben Briggs). + +## 0.4 +* Add `config` option and `BROWSERSLIST_CONFIG` environment variable support. +* Add symlink config support. + +## 0.3.3 +* Fix DynJS compatibility (by Nick Howes). + +## 0.3.2 +* Fix joined versions on versions query (by Vincent De Oliveira). + +## 0.3.1 +* Fix global variable leak (by Peter Müller). + +## 0.3 +* Takes queries from `BROWSERSLIST` environment variable. + +## 0.2 +* Return Can I Use joined versions as `ios_saf 7.0-7.1`. + +## 0.1.3 +* Better work with Can I Use joined versions like `ios_saf 7.0-7.1`. +* Browserslist now understands `ios_saf 7.0` or `ios_saf 7`. + +## 0.1.2 +* Do not create global `browserslist` var (by Maxime Thirouin). + +## 0.1.1 +* Sort browsers by name and version. + +## 0.1 +* Initial release. diff --git a/node_modules/rucksack-css/node_modules/browserslist/LICENSE b/node_modules/rucksack-css/node_modules/browserslist/LICENSE new file mode 100644 index 00000000..1ae47a20 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/browserslist/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2014 Andrey Sitnik + +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. diff --git a/node_modules/rucksack-css/node_modules/browserslist/README.md b/node_modules/rucksack-css/node_modules/browserslist/README.md new file mode 100644 index 00000000..d36c8020 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/browserslist/README.md @@ -0,0 +1,455 @@ +# Browserslist + +Browserslist logo by Anton Lovchikov + +Library to share target browsers between different front-end tools. +It is used in: + +* [Autoprefixer] +* [babel-preset-env] + (external config in `package.json` or `browserslist` will be supported in 7.0) +* [postcss-preset-env] +* [eslint-plugin-compat] +* [stylelint-no-unsupported-browser-features] +* [postcss-normalize] + +All tools that rely on Browserslist will find its config automatically, +when you add the following to `package.json`: + +```json +{ + "browserslist": [ + "> 1%", + "last 2 versions" + ] +} +``` + +Or in `.browserslistrc` config: + +```yaml +# Browsers that we support + +> 1% +Last 2 versions +IE 10 # sorry +``` + +Developers set browsers list in queries like `last 2 version` +to be free from updating browser versions manually. +Browserslist will use [Can I Use] data for this queries. + +Browserslist will take browsers queries from tool option, +`browserslist` config, `.browserslistrc` config, +`browserslist` section in `package.json` or environment variables. + +You can test Browserslist queries in [online demo]. + + + Sponsored by Evil Martians + + +[stylelint-no-unsupported-browser-features]: https://github.com/ismay/stylelint-no-unsupported-browser-features +[eslint-plugin-compat]: https://github.com/amilajack/eslint-plugin-compat +[postcss-preset-env]: https://github.com/jonathantneal/postcss-preset-env +[babel-preset-env]: https://github.com/babel/babel/tree/master/packages/babel-preset-env +[postcss-normalize]: https://github.com/jonathantneal/postcss-normalize +[Autoprefixer]: https://github.com/postcss/autoprefixer +[online demo]: http://browserl.ist/ +[Can I Use]: http://caniuse.com/ + +## Tools + +* [`browserslist-useragent`] checks browser by user agent string + to match Browserslist target browsers query. +* [`caniuse-api`] returns browsers which support some specific feature. +* Run `npx browserslist` in your project directory to see project’s + target browsers. This CLI tool is built-in and available in any project + with Autoprefixer. + +[`browserslist-useragent`]: https://github.com/pastelsky/browserslist-useragent +[`caniuse-api`]: https://github.com/Nyalab/caniuse-api + +## Queries + +Browserslist will use browsers query from one of this sources: + +1. Tool options. For example `browsers` option in Autoprefixer. +2. `BROWSERSLIST` environment variable. +3. `browserslist` config file in current or parent directories. +3. `.browserslistrc` config file in current or parent directories. +4. `browserslist` key in `package.json` file in current or parent directories. + **We recommend this way.** +5. If the above methods did not produce a valid result + Browserslist will use defaults: `> 1%, last 2 versions, Firefox ESR`. + +You can specify the versions by queries (case insensitive): + +* `last 2 versions`: the last 2 versions for each browser. +* `last 2 Chrome versions`: the last 2 versions of Chrome browser. +* `> 5%`: versions selected by global usage statistics. + `>=`, `<` and `<=` work too. +* `> 5% in US`: uses USA usage statistics. It accepts [two-letter country code]. +* `> 5% in alt-AS`: uses Asia region usage statistics. List of all region codes + can be found at [`caniuse-lite/data/regions`]. +* `> 5% in my stats`: uses [custom usage data]. +* `extends browserslist-config-mycompany`: take queries from + `browserslist-config-mycompany` npm package. +* `ie 6-8`: selects an inclusive range of versions. +* `Firefox > 20`: versions of Firefox newer than 20. + `>=`, `<` and `<=` work too. +* `iOS 7`: the iOS browser version 7 directly. +* `Firefox ESR`: the latest [Firefox ESR] version. +* `unreleased versions` or `unreleased Chrome versions`: + alpha and beta versions. +* `last 2 major versions` or `last 2 iOS major versions`: + all minor/patch releases of last 2 major versions. +* `since 2015` or `last 2 years`: all versions released since year 2015 + (also `since 2015-03` and `since 2015-03-10`). +* `not ie <= 8`: exclude browsers selected by previous queries. + +You can add `not ` to any query. + +### Debug + +Run `npx browserslist` in project directory to see what browsers was selected +by your queries. + +```sh +$ npx browserslist +and_chr 61 +and_ff 56 +and_qq 1.2 +and_uc 11.4 +android 56 +baidu 7.12 +bb 10 +chrome 62 +edge 16 +firefox 56 +ios_saf 11 +opera 48 +safari 11 +samsung 5 +``` + +### Notes + +Browserslist works with separated versions of browsers. +You should avoid queries like `Firefox > 0`. + +Multiple criteria are combined as a boolean `OR`. A browser version must match +at least one of the criteria to be selected. + +All queries are based on the [Can I Use] support table, +e.g. `last 3 iOS versions` might select `8.4, 9.2, 9.3` (mixed major and minor), +whereas `last 3 Chrome versions` might select `50, 49, 48` (major only). + +[`caniuse-lite/data/regions`]: https://github.com/ben-eb/caniuse-lite/tree/master/data/regions +[two-letter country code]: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements +[custom usage data]: #custom-usage-data +[Can I Use]: http://caniuse.com/ + +### Browsers + +Names are case insensitive: + +* `Android` for Android WebView. +* `Baidu` for Baidu Browser. +* `BlackBerry` or `bb` for Blackberry browser. +* `Chrome` for Google Chrome. +* `ChromeAndroid` or `and_chr` for Chrome for Android +* `Edge` for Microsoft Edge. +* `Electron` for Electron framework. It will be converted to Chrome version. +* `Explorer` or `ie` for Internet Explorer. +* `ExplorerMobile` or `ie_mob` for Internet Explorer Mobile. +* `Firefox` or `ff` for Mozilla Firefox. +* `FirefoxAndroid` or `and_ff` for Firefox for Android. +* `iOS` or `ios_saf` for iOS Safari. +* `Opera` for Opera. +* `OperaMini` or `op_mini` for Opera Mini. +* `OperaMobile` or `op_mob` for Opera Mobile. +* `QQAndroid` or `and_qq` for QQ Browser for Android. +* `Safari` for desktop Safari. +* `Samsung` for Samsung Internet. +* `UCAndroid` or `and_uc` for UC Browser for Android. + +## `package.json` + +If you want to reduce config files in project root, you can specify +browsers in `package.json` with `browserslist` key: + +```json +{ + "private": true, + "dependencies": { + "autoprefixer": "^6.5.4" + }, + "browserslist": [ + "> 1%", + "last 2 versions" + ] +} +``` + +## Config File + +Browserslist config should be named `.browserslistrc` or `browserslist` +and have browsers queries split by a new line. Comments starts with `#` symbol: + +```yaml +# Browsers that we support + +> 1% +Last 2 versions +IE 8 # sorry +``` + +Browserslist will check config in every directory in `path`. +So, if tool process `app/styles/main.css`, you can put config to root, +`app/` or `app/styles`. + +You can specify direct path in `BROWSERSLIST_CONFIG` environment variables. + +## Shareable Configs + +You can use the following query to reference an exported Browserslist config +from another package: + +```json + "browserslist": [ + "extends browserslist-config-mycompany" + ] +``` + +For security reasons, external configuration only supports packages that have +the `browserslist-config-` prefix. npm scoped packages are also supported, by +naming or prefixing the module with `@scope/browserslist-config`, such as +`@scope/browserslist-config` or `@scope/browserslist-config-mycompany`. + +If you don’t accept Browserslist queries from users, you can disable the +validation by using the `dangerousExtend` option: + +```js +browserslist(queries, { path, dangerousExtend: true }) +``` + +Because this uses `npm`'s resolution, you can also reference specific files +in a package: + +```json + "browserslist": [ + "extends browserslist-config-mycompany/desktop", + "extends browserslist-config-mycompany/mobile" + ] +``` + +When writing a shared Browserslist package, just export an array. +`browserslist-config-mycompany/index.js`: + +```js +module.exports = [ + 'last 2 versions', + 'ie 9' +] +``` + +## Environment Variables + +If some tool use Browserslist inside, you can change browsers settings +by [environment variables]: + +* `BROWSERSLIST` with browsers queries. + + ```sh + BROWSERSLIST="> 5%" gulp css + ``` + +* `BROWSERSLIST_CONFIG` with path to config file. + + ```sh + BROWSERSLIST_CONFIG=./config/browserslist gulp css + ``` + +* `BROWSERSLIST_ENV` with environments string. + + ```sh + BROWSERSLIST_ENV="development" gulp css + ``` + +* `BROWSERSLIST_STATS` with path to the custom usage data + for `> 1% in my stats` query. + + ```sh + BROWSERSLIST_STATS=./config/usage_data.json gulp css + ``` + +* `BROWSERSLIST_DISABLE_CACHE` if you want to disable config reading cache. + + ```sh + BROWSERSLIST_DISABLE_CACHE=1 gulp css + ``` + +[environment variables]: https://en.wikipedia.org/wiki/Environment_variable + +## Environments + +You can also specify different browser queries for various environments. +Browserslist will choose query according to `BROWSERSLIST_ENV` or `NODE_ENV` +variables. If none of them is declared, Browserslist will firstly look +for `development` queries and then use defaults. + +In `package.json`: + +```js + "browserslist": { + "production": [ + "last 2 version", + "ie 9" + ], + "development": [ + "last 1 version" + ] + } +``` + +In `.browserslistrc` config: + +```ini +[production] +last 2 version +ie 9 + +[development] +last 1 version +``` + +## Custom Usage Data + +If you have a website, you can query against the usage statistics of your site: + +1. Import your Google Analytics data into [Can I Use]. + Press `Import…` button in Settings page. +2. Open browser DevTools on [Can I Use] and paste this snippet + into the browser console: + + ```js + var e=document.createElement('a');e.setAttribute('href', 'data:text/plain;charset=utf-8,'+encodeURIComponent(JSON.stringify(JSON.parse(localStorage['usage-data-by-id'])[localStorage['config-primary_usage']])));e.setAttribute('download','stats.json');document.body.appendChild(e);e.click();document.body.removeChild(e); + ``` +3. Save the data to a `browserslist-stats.json` file in your project. + +Of course, you can generate usage statistics file by any other method. +File format should be like: + +```js +{ + "ie": { + "6": 0.01, + "7": 0.4, + "8": 1.5 + }, + "chrome": { + … + }, + … +} +``` + +Note that you can query against your custom usage data +while also querying against global or regional data. +For example, the query `> 1% in my stats, > 5% in US, 10%` is permitted. + +[Can I Use]: http://caniuse.com/ + +## Webpack + +If you plan to use Browserslist on client-side (e. g., tools like CodePen) +Browserslist could take big part of your bundle (150 KB). + +But the biggest part of this size will be region usage statistics, which could +be useless for you. `IgnorePlugin` could cut it: + +```js +const webpackConfig = { + … + plugins: [ + new webpack.IgnorePlugin(/caniuse-lite\/data\/regions/) + ] +} +``` + +This plugin will reduce Browserslist size from 150 KB to 6 KB. But you loose +`> 1% in US` queries support. + +## JS API + +```js +var browserslist = require('browserslist'); + +// Your CSS/JS build tool code +var process = function (source, opts) { + var browsers = browserslist(opts.browsers, { + stats: opts.stats, + path: opts.file, + env: opts.env + }); + // Your code to add features for selected browsers +} +``` + +Queries can be a string `"> 5%, last 1 version"` +or an array `['> 5%', 'last 1 version']`. + +If a query is missing, Browserslist will look for a config file. +You can provide a `path` option (that can be a file) to find the config file +relatively to it. + +For non-JS environment and debug purpose you can use CLI tool: + +```sh +browserslist "> 1%, last 2 versions" +``` + +## Coverage + +You can get total users coverage for selected browsers by JS API: + +```js +browserslist.coverage(browserslist('> 1%')) //=> 81.4 +``` + +```js +browserslist.coverage(browserslist('> 1% in US'), 'US') //=> 83.1 +``` + +Or by CLI: + +```sh +$ browserslist --coverage "> 1%" +These browsers account for 81.4% of all users globally +``` + +```sh +$ browserslist --coverage=US "> 1% in US" +These browsers account for 83.1% of all users in the US +``` + +## Cache + +Browserslist caches the configuration it reads from `package.json` and +`browserslist` files, as well as knowledge about the existence of files, +for the duration of the hosting process. + +To clear these caches, use: + +```js +browserslist.clearCaches(); +``` + +To disable the caching altogether, set the `BROWSERSLIST_DISABLE_CACHE` +environment variable. diff --git a/node_modules/rucksack-css/node_modules/browserslist/browser.js b/node_modules/rucksack-css/node_modules/browserslist/browser.js new file mode 100644 index 00000000..fdf65d04 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/browserslist/browser.js @@ -0,0 +1,29 @@ +var BrowserslistError = require('./error') + +function noop () { } + +module.exports = { + loadQueries: function loadQueries () { + throw new BrowserslistError( + 'Sharable configs are not supported in client-side build of Browserslist') + }, + + getStat: function getStat (opts) { + return opts.stats + }, + + loadConfig: function loadConfig (opts) { + if (opts.config) { + throw new BrowserslistError( + 'Browserslist config are not supported in client-side build') + } + }, + + parseConfig: noop, + + readConfig: noop, + + findConfig: noop, + + clearCaches: noop +} diff --git a/node_modules/rucksack-css/node_modules/browserslist/cli.js b/node_modules/rucksack-css/node_modules/browserslist/cli.js new file mode 100755 index 00000000..2a6bb913 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/browserslist/cli.js @@ -0,0 +1,103 @@ +#!/usr/bin/env node + +var browserslist = require('./') +var pkg = require('./package.json') +var args = process.argv.slice(2) + +var USAGE = 'Usage:\n' + + ' ' + pkg.name + '\n' + + ' ' + pkg.name + ' "QUERIES"\n' + + ' ' + pkg.name + ' --config="path/to/browserlist/file"\n' + + ' ' + pkg.name + ' --coverage "QUERIES"\n' + + ' ' + pkg.name + ' --coverage=US "QUERIES"\n' + + ' ' + pkg.name + ' --env="environment name defined in config"\n' + + ' ' + pkg.name + ' --stats="path/to/browserlist/stats/file"' + +function isArg (arg) { + return args.some(function (str) { + return str === arg || str.indexOf(arg + '=') === 0 + }) +} + +function error (msg) { + process.stderr.write(pkg.name + ': ' + msg + '\n') + process.exit(1) +} + +if (isArg('--help') || isArg('-h')) { + process.stdout.write(pkg.description + '.\n\n' + USAGE + '\n') +} else if (isArg('--version') || isArg('-v')) { + process.stdout.write(pkg.name + ' ' + pkg.version + '\n') +} else { + var mode = 'browsers' + var opts = { } + var queries + var country + + for (var i = 0; i < args.length; i++) { + if (args[i][0] !== '-') { + queries = args[i].replace(/^['"]|['"]$/g, '') + continue + } + + var arg = args[i].split('=') + var name = arg[0] + var value = arg[1] + + if (value) value = value.replace(/^['"]|['"]$/g, '') + + if (name === '--config' || name === '-b') { + opts.config = value + } else if (name === '--env' || name === '-e') { + opts.env = value + } else if (name === '--stats' || name === '-s') { + opts.stats = value + } else if (name === '--coverage' || name === '-c') { + mode = 'coverage' + if (value) country = value + } else { + error('Unknown arguments ' + args[i] + '.\n\n' + USAGE) + } + } + + if (!queries && !opts.config) { + if (browserslist.findConfig(process.cwd())) { + opts.path = process.cwd() + } else { + error( + 'Browserslist config did not found. ' + + 'Define queries or config path.' + + '\n\n' + USAGE + ) + } + } + + var browsers + try { + browsers = browserslist(queries, opts) + } catch (e) { + if (e.name === 'BrowserslistError') { + error(e.message) + } else { + throw e + } + } + + if (mode === 'browsers') { + browsers.forEach(function (browser) { + process.stdout.write(browser + '\n') + }) + } else { + var result = browserslist.coverage(browsers, country) + var round = Math.round(result * 100) / 100.0 + + var end = 'globally' + if (country && country !== 'global') { + end = 'in the ' + country.toUpperCase() + } + + process.stdout.write( + 'These browsers account for ' + round + '% of all users ' + + end + '\n') + } +} diff --git a/node_modules/rucksack-css/node_modules/browserslist/error.js b/node_modules/rucksack-css/node_modules/browserslist/error.js new file mode 100644 index 00000000..793e9e83 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/browserslist/error.js @@ -0,0 +1,12 @@ +function BrowserslistError (message) { + this.name = 'BrowserslistError' + this.message = message || '' + this.browserslist = true + if (Error.captureStackTrace) { + Error.captureStackTrace(this, BrowserslistError) + } +} + +BrowserslistError.prototype = Error.prototype + +module.exports = BrowserslistError diff --git a/node_modules/rucksack-css/node_modules/browserslist/index.js b/node_modules/rucksack-css/node_modules/browserslist/index.js new file mode 100644 index 00000000..ecbeb474 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/browserslist/index.js @@ -0,0 +1,671 @@ +var path = require('path') +var e2c = require('electron-to-chromium/versions') + +var agents = require('caniuse-lite/dist/unpacker/agents').agents +var region = require('caniuse-lite/dist/unpacker/region').default + +var BrowserslistError = require('./error') +var env = require('./node') // Will load browser.js in webpack + +var FLOAT_RANGE = /^\d+(\.\d+)?(-\d+(\.\d+)?)*$/ + +function normalize (versions) { + return versions.filter(function (version) { + return typeof version === 'string' + }) +} + +function nameMapper (name) { + return function mapName (version) { + return name + ' ' + version + } +} + +function getMajor (version) { + return parseInt(version.split('.')[0]) +} + +function getMajorVersions (released, number) { + if (released.length === 0) return [] + var minimum = getMajor(released[released.length - 1]) - parseInt(number) + 1 + var selected = [] + for (var i = released.length - 1; i >= 0; i--) { + if (minimum > getMajor(released[i])) break + selected.unshift(released[i]) + } + return selected +} + +function uniq (array) { + var filtered = [] + for (var i = 0; i < array.length; i++) { + if (filtered.indexOf(array[i]) === -1) filtered.push(array[i]) + } + return filtered +} + +// Helpers + +function fillUsage (result, name, data) { + for (var i in data) { + result[name + ' ' + i] = data[i] + } +} + +function generateFilter (sign, version) { + version = parseFloat(version) + if (sign === '>') { + return function (v) { + return parseFloat(v) > version + } + } else if (sign === '>=') { + return function (v) { + return parseFloat(v) >= version + } + } else if (sign === '<') { + return function (v) { + return parseFloat(v) < version + } + } else { + return function (v) { + return parseFloat(v) <= version + } + } +} + +function compareStrings (a, b) { + if (a < b) return -1 + if (a > b) return +1 + return 0 +} + +function normalizeVersion (data, version) { + if (data.versions.indexOf(version) !== -1) { + return version + } else if (browserslist.versionAliases[data.name][version]) { + return browserslist.versionAliases[data.name][version] + } else if (data.versions.length === 1) { + return data.versions[0] + } else { + return false + } +} + +function loadCountryStatistics (country) { + country = country.replace(/[^\w-]/g, '') + if (!browserslist.usage[country]) { + var usage = { } + // eslint-disable-next-line security/detect-non-literal-require + var compressed = require('caniuse-lite/data/regions/' + country + '.js') + var data = region(compressed) + for (var i in data) { + fillUsage(usage, i, data[i]) + } + browserslist.usage[country] = usage + } +} + +function filterByYear (since) { + return Object.keys(agents).reduce(function (selected, name) { + var data = byName(name) + if (!data) return selected + var versions = Object.keys(data.releaseDate).filter(function (v) { + return data.releaseDate[v] >= since + }) + return selected.concat(versions.map(nameMapper(data.name))) + }, []) +} + +function byName (name) { + name = name.toLowerCase() + name = browserslist.aliases[name] || name + return browserslist.data[name] +} + +function checkName (name) { + var data = byName(name) + if (!data) throw new BrowserslistError('Unknown browser ' + name) + return data +} + +function resolve (queries, context) { + return queries.reduce(function (result, selection, index) { + selection = selection.trim() + if (selection === '') return result + + var isExclude = selection.indexOf('not ') === 0 + if (isExclude) { + if (index === 0) { + throw new BrowserslistError( + 'Write any browsers query (for instance, `defaults`) ' + + 'before `' + selection + '`') + } + selection = selection.slice(4) + } + + for (var i = 0; i < QUERIES.length; i++) { + var type = QUERIES[i] + var match = selection.match(type.regexp) + if (match) { + var args = [context].concat(match.slice(1)) + var array = type.select.apply(browserslist, args) + if (isExclude) { + array = array.concat(array.map(function (j) { + return j.replace(/\s\d+/, ' 0') + })) + return result.filter(function (j) { + return array.indexOf(j) === -1 + }) + } + return result.concat(array) + } + } + + throw new BrowserslistError('Unknown browser query `' + selection + '`') + }, []) +} + +/** + * Return array of browsers by selection queries. + * + * @param {(string|string[])} [queries=browserslist.defaults] Browser queries. + * @param {object} opts Options. + * @param {string} [opts.path="."] Path to processed file. + * It will be used to find config files. + * @param {string} [opts.env="development"] Processing environment. + * It will be used to take right + * queries from config file. + * @param {string} [opts.config] Path to config file with queries. + * @param {object} [opts.stats] Custom browser usage statistics + * for "> 1% in my stats" query. + * @return {string[]} Array with browser names in Can I Use. + * + * @example + * browserslist('IE >= 10, IE 8') //=> ['ie 11', 'ie 10', 'ie 8'] + */ +function browserslist (queries, opts) { + if (typeof opts === 'undefined') opts = { } + + if (!opts.hasOwnProperty('path')) { + opts.path = path.resolve ? path.resolve('.') : '.' + } + + if (typeof queries === 'undefined' || queries === null) { + var config = env.loadConfig(opts) + if (config) { + queries = config + } else { + queries = browserslist.defaults + } + } + + if (typeof queries === 'string') { + queries = queries.split(/,\s*/) + } + + if (!Array.isArray(queries)) { + throw new BrowserslistError( + 'Browser queries must be an array. Got ' + typeof queries + '.') + } + + var context = { dangerousExtend: opts.dangerousExtend } + + var stats = env.getStat(opts) + if (stats) { + if ('dataByBrowser' in stats) { + stats = stats.dataByBrowser + } + context.customUsage = { } + for (var browser in stats) { + fillUsage(context.customUsage, browser, stats[browser]) + } + } + + var result = resolve(queries, context).map(function (i) { + var parts = i.split(' ') + var name = parts[0] + var version = parts[1] + if (version === '0') { + return name + ' ' + byName(name).versions[0] + } else { + return i + } + }).sort(function (name1, name2) { + name1 = name1.split(' ') + name2 = name2.split(' ') + if (name1[0] === name2[0]) { + if (FLOAT_RANGE.test(name1[1]) && FLOAT_RANGE.test(name2[1])) { + return parseFloat(name2[1]) - parseFloat(name1[1]) + } else { + return compareStrings(name2[1], name1[1]) + } + } else { + return compareStrings(name1[0], name2[0]) + } + }) + + return uniq(result) +} + +// Will be filled by Can I Use data below +browserslist.data = { } +browserslist.usage = { + global: { }, + custom: null +} + +// Default browsers query +browserslist.defaults = [ + '> 1%', + 'last 2 versions', + 'Firefox ESR' +] + +// Browser names aliases +browserslist.aliases = { + fx: 'firefox', + ff: 'firefox', + ios: 'ios_saf', + explorer: 'ie', + blackberry: 'bb', + explorermobile: 'ie_mob', + operamini: 'op_mini', + operamobile: 'op_mob', + chromeandroid: 'and_chr', + firefoxandroid: 'and_ff', + ucandroid: 'and_uc', + qqandroid: 'and_qq' +} + +// Aliases to work with joined versions like `ios_saf 7.0-7.1` +browserslist.versionAliases = { } + +browserslist.clearCaches = env.clearCaches +browserslist.parseConfig = env.parseConfig +browserslist.readConfig = env.readConfig +browserslist.findConfig = env.findConfig + +/** + * Return browsers market coverage. + * + * @param {string[]} browsers Browsers names in Can I Use. + * @param {string} [country="global"] Which country statistics should be used. + * + * @return {number} Total market coverage for all selected browsers. + * + * @example + * browserslist.coverage(browserslist('> 1% in US'), 'US') //=> 83.1 + */ +browserslist.coverage = function (browsers, country) { + if (country && country !== 'global') { + if (country.length > 2) { + country = country.toLowerCase() + } else { + country = country.toUpperCase() + } + loadCountryStatistics(country) + } else { + country = 'global' + } + + return browsers.reduce(function (all, i) { + var usage = browserslist.usage[country][i] + if (usage === undefined) { + usage = browserslist.usage[country][i.replace(/ [\d.]+$/, ' 0')] + } + return all + (usage || 0) + }, 0) +} + +var QUERIES = [ + { + regexp: /^last\s+(\d+)\s+major versions?$/i, + select: function (context, versions) { + return Object.keys(agents).reduce(function (selected, name) { + var data = byName(name) + if (!data) return selected + var array = getMajorVersions(data.released, versions) + + array = array.map(nameMapper(data.name)) + return selected.concat(array) + }, []) + } + }, + { + regexp: /^last\s+(\d+)\s+versions?$/i, + select: function (context, versions) { + return Object.keys(agents).reduce(function (selected, name) { + var data = byName(name) + if (!data) return selected + var array = data.released.slice(-versions) + + array = array.map(nameMapper(data.name)) + return selected.concat(array) + }, []) + } + }, + { + regexp: /^last\s+(\d+)\s+electron\s+major versions?$/i, + select: function (context, versions) { + var validVersions = getMajorVersions(Object.keys(e2c).reverse(), versions) + return validVersions.map(function (i) { + return 'chrome ' + e2c[i] + }) + } + }, + { + regexp: /^last\s+(\d+)\s+(\w+)\s+major versions?$/i, + select: function (context, versions, name) { + var data = checkName(name) + var validVersions = getMajorVersions(data.released, versions) + return validVersions.map(nameMapper(data.name)) + } + }, + { + regexp: /^last\s+(\d+)\s+electron\s+versions?$/i, + select: function (context, versions) { + return Object.keys(e2c).reverse().slice(-versions).map(function (i) { + return 'chrome ' + e2c[i] + }) + } + }, + { + regexp: /^last\s+(\d+)\s+(\w+)\s+versions?$/i, + select: function (context, versions, name) { + var data = checkName(name) + return data.released.slice(-versions).map(nameMapper(data.name)) + } + }, + { + regexp: /^unreleased\s+versions$/i, + select: function () { + return Object.keys(agents).reduce(function (selected, name) { + var data = byName(name) + if (!data) return selected + var array = data.versions.filter(function (v) { + return data.released.indexOf(v) === -1 + }) + + array = array.map(nameMapper(data.name)) + return selected.concat(array) + }, []) + } + }, + { + regexp: /^unreleased\s+electron\s+versions?$/i, + select: function () { + return [] + } + }, + { + regexp: /^unreleased\s+(\w+)\s+versions?$/i, + select: function (context, name) { + var data = checkName(name) + return data.versions.filter(function (v) { + return data.released.indexOf(v) === -1 + }).map(nameMapper(data.name)) + } + }, + { + regexp: /^last\s+(\d+)\s+years?$/i, + select: function (context, years) { + var date = new Date() + var since = date.setFullYear(date.getFullYear() - years) / 1000 + + return filterByYear(since) + } + }, + { + regexp: /^since (\d+)(?:-(\d+))?(?:-(\d+))?$/i, + select: function (context, year, month, date) { + year = parseInt(year) + month = parseInt(month || '01') - 1 + date = parseInt(date || '01') + var since = Date.UTC(year, month, date, 0, 0, 0) / 1000 + + return filterByYear(since) + } + }, + { + regexp: /^(>=?|<=?)\s*(\d*\.?\d+)%$/, + select: function (context, sign, popularity) { + popularity = parseFloat(popularity) + var usage = browserslist.usage.global + + return Object.keys(usage).reduce(function (result, version) { + if (sign === '>') { + if (usage[version] > popularity) { + result.push(version) + } + } else if (sign === '<') { + if (usage[version] < popularity) { + result.push(version) + } + } else if (sign === '<=') { + if (usage[version] <= popularity) { + result.push(version) + } + } else if (usage[version] >= popularity) { + result.push(version) + } + return result + }, []) + } + }, + { + regexp: /^(>=?|<=?)\s*(\d*\.?\d+)%\s+in\s+my\s+stats$/, + select: function (context, sign, popularity) { + popularity = parseFloat(popularity) + + if (!context.customUsage) { + throw new BrowserslistError('Custom usage statistics was not provided') + } + + var usage = context.customUsage + + return Object.keys(usage).reduce(function (result, version) { + if (sign === '>') { + if (usage[version] > popularity) { + result.push(version) + } + } else if (sign === '<') { + if (usage[version] < popularity) { + result.push(version) + } + } else if (sign === '<=') { + if (usage[version] <= popularity) { + result.push(version) + } + } else if (usage[version] >= popularity) { + result.push(version) + } + return result + }, []) + } + }, + { + regexp: /^(>=?|<=?)\s*(\d*\.?\d+)%\s+in\s+((alt-)?\w\w)$/, + select: function (context, sign, popularity, place) { + popularity = parseFloat(popularity) + + if (place.length === 2) { + place = place.toUpperCase() + } else { + place = place.toLowerCase() + } + + loadCountryStatistics(place) + var usage = browserslist.usage[place] + + return Object.keys(usage).reduce(function (result, version) { + if (sign === '>') { + if (usage[version] > popularity) { + result.push(version) + } + } else if (sign === '<') { + if (usage[version] < popularity) { + result.push(version) + } + } else if (sign === '<=') { + if (usage[version] <= popularity) { + result.push(version) + } + } else if (usage[version] >= popularity) { + result.push(version) + } + return result + }, []) + } + }, + { + regexp: /^electron\s+([\d.]+)\s*-\s*([\d.]+)$/i, + select: function (context, from, to) { + if (!e2c[from]) { + throw new BrowserslistError('Unknown version ' + from + ' of electron') + } + if (!e2c[to]) { + throw new BrowserslistError('Unknown version ' + to + ' of electron') + } + + from = parseFloat(from) + to = parseFloat(to) + + return Object.keys(e2c).filter(function (i) { + var parsed = parseFloat(i) + return parsed >= from && parsed <= to + }).map(function (i) { + return 'chrome ' + e2c[i] + }) + } + }, + { + regexp: /^(\w+)\s+([\d.]+)\s*-\s*([\d.]+)$/i, + select: function (context, name, from, to) { + var data = checkName(name) + from = parseFloat(normalizeVersion(data, from) || from) + to = parseFloat(normalizeVersion(data, to) || to) + + function filter (v) { + var parsed = parseFloat(v) + return parsed >= from && parsed <= to + } + + return data.released.filter(filter).map(nameMapper(data.name)) + } + }, + { + regexp: /^electron\s*(>=?|<=?)\s*([\d.]+)$/i, + select: function (context, sign, version) { + return Object.keys(e2c) + .filter(generateFilter(sign, version)) + .map(function (i) { + return 'chrome ' + e2c[i] + }) + } + }, + { + regexp: /^(\w+)\s*(>=?|<=?)\s*([\d.]+)$/, + select: function (context, name, sign, version) { + var data = checkName(name) + var alias = browserslist.versionAliases[data.name][version] + if (alias) { + version = alias + } + return data.released + .filter(generateFilter(sign, version)) + .map(function (v) { + return data.name + ' ' + v + }) + } + }, + { + regexp: /^(firefox|ff|fx)\s+esr$/i, + select: function () { + return ['firefox 52'] + } + }, + { + regexp: /(operamini|op_mini)\s+all/i, + select: function () { + return ['op_mini all'] + } + }, + { + regexp: /^electron\s+([\d.]+)$/i, + select: function (context, version) { + var chrome = e2c[version] + if (!chrome) { + throw new BrowserslistError( + 'Unknown version ' + version + ' of electron') + } + return ['chrome ' + chrome] + } + }, + { + regexp: /^(\w+)\s+(tp|[\d.]+)$/i, + select: function (context, name, version) { + if (/^tp$/i.test(version)) version = 'TP' + var data = checkName(name) + var alias = normalizeVersion(data, version) + if (alias) { + version = alias + } else { + if (version.indexOf('.') === -1) { + alias = version + '.0' + } else if (/\.0$/.test(version)) { + alias = version.replace(/\.0$/, '') + } + alias = normalizeVersion(data, alias) + if (alias) { + version = alias + } else { + throw new BrowserslistError( + 'Unknown version ' + version + ' of ' + name) + } + } + return [data.name + ' ' + version] + } + }, + { + regexp: /^extends (.+)$/i, + select: function (context, name) { + return resolve(env.loadQueries(context, name), context) + } + }, + { + regexp: /^defaults$/i, + select: function () { + return browserslist(browserslist.defaults) + } + } +]; + +// Get and convert Can I Use data + +(function () { + for (var name in agents) { + var browser = agents[name] + browserslist.data[name] = { + name: name, + versions: normalize(agents[name].versions), + released: normalize(agents[name].versions.slice(0, -3)), + releaseDate: agents[name].release_date + } + fillUsage(browserslist.usage.global, name, browser.usage_global) + + browserslist.versionAliases[name] = { } + for (var i = 0; i < browser.versions.length; i++) { + var full = browser.versions[i] + if (!full) continue + + if (full.indexOf('-') !== -1) { + var interval = full.split('-') + for (var j = 0; j < interval.length; j++) { + browserslist.versionAliases[name][interval[j]] = full + } + } + } + } +}()) + +module.exports = browserslist diff --git a/node_modules/rucksack-css/node_modules/browserslist/node.js b/node_modules/rucksack-css/node_modules/browserslist/node.js new file mode 100644 index 00000000..ce67e3ee --- /dev/null +++ b/node_modules/rucksack-css/node_modules/browserslist/node.js @@ -0,0 +1,215 @@ +var path = require('path') +var fs = require('fs') + +var BrowserslistError = require('./error') + +var IS_SECTION = /^\s*\[(.+)\]\s*$/ +var CONFIG_PATTERN = /^browserslist-config-/ +var SCOPED_CONFIG__PATTERN = /@[^./]+\/browserslist-config(-|$)/ + +var filenessCache = { } +var configCache = { } + +function checkExtend (name) { + var use = ' Use `dangerousExtend` option to disable.' + if (!CONFIG_PATTERN.test(name) && !SCOPED_CONFIG__PATTERN.test(name)) { + throw new BrowserslistError( + 'Browserslist config needs `browserslist-config-` prefix. ' + use) + } + if (name.indexOf('.') !== -1) { + throw new BrowserslistError( + '`.` not allowed in Browserslist config name. ' + use) + } + if (name.indexOf('node_modules') !== -1) { + throw new BrowserslistError( + '`node_modules` not allowed in Browserslist config.' + use) + } +} + +function isFile (file) { + if (file in filenessCache) { + return filenessCache[file] + } + var result = fs.existsSync(file) && fs.statSync(file).isFile() + if (!process.env.BROWSERSLIST_DISABLE_CACHE) { + filenessCache[file] = result + } + return result +} + +function eachParent (file, callback) { + var loc = path.resolve(file) + do { + var result = callback(loc) + if (typeof result !== 'undefined') return result + } while (loc !== (loc = path.dirname(loc))) + return undefined +} + +function pickEnv (config, opts) { + if (typeof config !== 'object') return config + + var name + if (typeof opts.env === 'string') { + name = opts.env + } else if (process.env.BROWSERSLIST_ENV) { + name = process.env.BROWSERSLIST_ENV + } else if (process.env.NODE_ENV) { + name = process.env.NODE_ENV + } else { + name = 'development' + } + + return config[name] || config.defaults +} + +function parsePackage (file) { + var config = JSON.parse(fs.readFileSync(file)) + if (config.browserlist && !config.browserslist) { + throw new BrowserslistError( + '`browserlist` key instead of `browserslist` in ' + file) + } + var list = config.browserslist + if (typeof list === 'object' && list.length) { + list = { defaults: list } + } + return list +} + +module.exports = { + loadQueries: function loadQueries (context, name) { + if (!context.dangerousExtend) checkExtend(name) + // eslint-disable-next-line security/detect-non-literal-require + var queries = require(name) + if (!Array.isArray(queries)) { + throw new BrowserslistError( + '`' + name + '` config exports not an array of queries') + } + return queries + }, + + getStat: function getStat (opts) { + var stats + if (opts.stats) { + stats = opts.stats + } else if (process.env.BROWSERSLIST_STATS) { + stats = process.env.BROWSERSLIST_STATS + } else if (opts.path && path.resolve && fs.existsSync) { + stats = eachParent(opts.path, function (dir) { + var file = path.join(dir, 'browserslist-stats.json') + return isFile(file) ? file : undefined + }) + } + + if (typeof stats === 'string') { + try { + stats = JSON.parse(fs.readFileSync(stats)) + } catch (e) { + throw new BrowserslistError('Can\'t read ' + stats) + } + } + + return stats + }, + + loadConfig: function loadConfig (opts) { + if (process.env.BROWSERSLIST) { + return process.env.BROWSERSLIST + } else if (opts.config || process.env.BROWSERSLIST_CONFIG) { + var file = opts.config || process.env.BROWSERSLIST_CONFIG + if (path.basename(file) === 'package.json') { + return pickEnv(parsePackage(file), opts) + } else { + return pickEnv(module.exports.readConfig(file), opts) + } + } else if (opts.path) { + return pickEnv(module.exports.findConfig(opts.path), opts) + } else { + return undefined + } + }, + + parseConfig: function parseConfig (string) { + var result = { defaults: [] } + var section = 'defaults' + + string.toString() + .replace(/#[^\n]*/g, '') + .split(/\n/) + .map(function (line) { + return line.trim() + }) + .filter(function (line) { + return line !== '' + }) + .forEach(function (line) { + if (IS_SECTION.test(line)) { + section = line.match(IS_SECTION)[1].trim() + result[section] = result[section] || [] + } else { + result[section].push(line) + } + }) + + return result + }, + + readConfig: function readConfig (file) { + if (!isFile(file)) { + throw new BrowserslistError('Can\'t read ' + file + ' config') + } + return module.exports.parseConfig(fs.readFileSync(file)) + }, + + findConfig: function findConfig (from) { + from = path.resolve(from) + + var cacheKey = isFile(from) ? path.dirname(from) : from + if (cacheKey in configCache) { + return configCache[cacheKey] + } + + var resolved = eachParent(from, function (dir) { + var config = path.join(dir, 'browserslist') + var pkg = path.join(dir, 'package.json') + var rc = path.join(dir, '.browserslistrc') + + var pkgBrowserslist + if (isFile(pkg)) { + try { + pkgBrowserslist = parsePackage(pkg) + } catch (e) { + if (e.name === 'BrowserslistError') throw e + console.warn( + '[Browserslist] Could not parse ' + pkg + '. Ignoring it.') + } + } + + if (isFile(config) && pkgBrowserslist) { + throw new BrowserslistError( + dir + ' contains both browserslist and package.json with browsers') + } else if (isFile(rc) && pkgBrowserslist) { + throw new BrowserslistError( + dir + ' contains both .browserslistrc and package.json with browsers') + } else if (isFile(config) && isFile(rc)) { + throw new BrowserslistError( + dir + ' contains both .browserslistrc and browserslist') + } else if (isFile(config)) { + return module.exports.readConfig(config) + } else if (isFile(rc)) { + return module.exports.readConfig(rc) + } else { + return pkgBrowserslist + } + }) + if (!process.env.BROWSERSLIST_DISABLE_CACHE) { + configCache[cacheKey] = resolved + } + return resolved + }, + + clearCaches: function clearCaches () { + filenessCache = { } + configCache = { } + } +} diff --git a/node_modules/rucksack-css/node_modules/browserslist/package.json b/node_modules/rucksack-css/node_modules/browserslist/package.json new file mode 100644 index 00000000..b8e8572b --- /dev/null +++ b/node_modules/rucksack-css/node_modules/browserslist/package.json @@ -0,0 +1,86 @@ +{ + "name": "browserslist", + "version": "2.11.3", + "description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset", + "keywords": [ + "caniuse", + "browsers", + "target" + ], + "author": "Andrey Sitnik ", + "license": "MIT", + "repository": "ai/browserslist", + "dependencies": { + "caniuse-lite": "^1.0.30000792", + "electron-to-chromium": "^1.3.30" + }, + "bin": "./cli.js", + "devDependencies": { + "cross-spawn": "^5.1.0", + "eslint": "^4.15.0", + "eslint-ci": "^0.1.1", + "eslint-config-logux": "^17.0.0", + "eslint-config-standard": "^10.2.1", + "eslint-plugin-es5": "^1.2.0", + "eslint-plugin-import": "^2.8.0", + "eslint-plugin-jest": "^21.6.2", + "eslint-plugin-node": "^5.2.1", + "eslint-plugin-promise": "^3.6.0", + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-standard": "^3.0.1", + "jest": "^22.0.6", + "lint-staged": "^6.0.0", + "pre-commit": "^1.1.3", + "size-limit": "^0.14.0", + "yaspeller-ci": "^1.0.0" + }, + "eslintConfig": { + "extends": "eslint-config-logux/browser", + "rules": { + "security/detect-unsafe-regex": "off", + "global-require": "off" + }, + "overrides": { + "files": [ + "*.test.js" + ], + "rules": { + "es5/no-arrow-functions": "off" + } + } + }, + "jest": { + "testEnvironment": "node", + "coverageThreshold": { + "global": { + "statements": 100 + } + }, + "modulePathIgnorePatterns": [ + "/test/fixtures" + ] + }, + "size-limit": [ + { + "path": "index.js", + "limit": "160 KB" + } + ], + "scripts": { + "lint-staged": "lint-staged", + "spellcheck": "yaspeller-ci README.md CHANGELOG.md", + "lint": "eslint-ci *.js test/*.js __mocks__/*.js", + "test": "jest --coverage && yarn lint && yarn spellcheck && size-limit" + }, + "lint-staged": { + "*.md": "yaspeller-ci", + "*.js": "eslint" + }, + "browser": { + "./node.js": "./browser.js", + "path": false + }, + "pre-commit": [ + "lint-staged" + ] +} diff --git a/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/CHANGELOG.md b/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/CHANGELOG.md new file mode 100644 index 00000000..60a29038 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/CHANGELOG.md @@ -0,0 +1,45 @@ +# 3.0.0 - 2017-07-08 + +- Updated postcss v6.x +- Updated dependencies +- droped old nodejs version + +# 2.2.0 - 2015-12-30 + +- added: support for backgroundColor for alpha matte calculation + +# 2.1.0 - 2015-12-29 + +- added: fallback option for ie8 + +# 2.0.0 - 2015-09-06 + +- Removed: compatibility with postcss v4.x +- Added: compatibility with postcss v5.x + +# 1.3.1 - 2015-07-21 + +- Added: minor code changes by switching from jshint to eslint +([#4](https://github.com/postcss/postcss-color-rgba-fallback/issues/4) + +# 1.3.0 - 2015-06-24 + +- Added: fallback are added only for a `properties` whitelist +- Added: fallback are skipped when there is already one +([#11](https://github.com/postcss/postcss-color-rgba-fallback/issues/11) + +# 1.2.0 - 2015-05-23 + +- Added: use PostCSS 4.1 API + +# 1.1.1 - 2015-04-24 + +- Fixed: detect if there is already a fallback. + +# 1.1.0 - 2015-04-20 + +- Added: detect if there is already a fallback. + +# 1.0.0 - 2015-04-15 + +Initial release diff --git a/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/LICENSE b/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/LICENSE new file mode 100755 index 00000000..28c7244c --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2015 Guillaume Démésy + +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. diff --git a/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/README.md b/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/README.md new file mode 100644 index 00000000..89e5c9ea --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/README.md @@ -0,0 +1,104 @@ +# postcss-color-rgba-fallback [![Travis Build Status](https://travis-ci.org/postcss/postcss-color-rgba-fallback.svg)](https://travis-ci.org/postcss/postcss-color-rgba-fallback) + +> [PostCSS](https://github.com/postcss/postcss) plugin to transform rgba() to hexadecimal. + +## Installation + +```bash +$ npm install postcss-color-rgba-fallback +``` + +## Usage + +```js +// dependencies +var fs = require("fs") +var postcss = require("postcss") +var colorRgbaFallback = require("postcss-color-rgba-fallback") + +// css to be processed +var css = fs.readFileSync("input.css", "utf8") + +// process css +var output = postcss() + .use(colorRgbaFallback()) + .process(css) + .css +``` + +Using this `input.css`: + +```css +body { + background: rgba(153, 221, 153, 0.8); + border: solid 1px rgba(100,102,103,.3); +} + +``` + +you will get: + +```css +body { + background: #99DD99; + background: rgba(153, 221, 153, 0.8); + border: solid 1px #646667; + border: solid 1px rgba(100,102,103,.3); +} +``` + +## Node.js options + +postcss-color-rgba-fallback accepts options + +### `properties` + +default: ` +[ "background-color", + "background", + "color", + "border", + "border-color", + "outline", + "outline-color ] +` + +Allows you to specify your whitelist of properties. +**This option enables adding a fallback for one or a properties list** + +### `oldie` + +default: `false` + +Set to true to enable the option and to get fallback for ie8 + +### `backgroundColor` + +default: `null` + +Allows you to specify a background color to use as a base alpha matte. + +Instead of cutting off the alpha channel it will blend the foreground and background. + +Expects an array of rgb values: + +```js + "backgroundColor": [255, 1, 1] +``` + +Checkout [tests](test) for more examples. + +--- + +## Contributing + +Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature. + + $ git clone https://github.com/postcss/postcss-color-rgba-fallback.git + $ git checkout -b patch-1 + $ npm install + $ npm test + +## [Changelog](CHANGELOG.md) + +## [License](LICENSE) diff --git a/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/index.js b/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/index.js new file mode 100644 index 00000000..6fd67efa --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/index.js @@ -0,0 +1,141 @@ +/** + * Module dependencies. + */ +var postcss = require("postcss") +var valueParser = require("postcss-value-parser") +var rgbToHex = require("rgb-hex") + +/** + * Calculate the color of a chanel + * based upon two 0-255 colors and a 0-1 alpha value + */ +function calcChannel(backgroundColor, foregroundColor, alpha) { + var value = backgroundColor + (foregroundColor - backgroundColor) * alpha + return Math.round(value) +} + +/** + * Given a solid rgb background and a rgba foreground color + * it calculates the color of the values combined into a single rgb array + * If there is no background color + * strips off the alpha value from the foreground + */ +function calculateRGB(backgroundColor, foregroundColor) { + if (backgroundColor) { + return [ + calcChannel(backgroundColor[0], foregroundColor[0], foregroundColor[3]), + calcChannel(backgroundColor[1], foregroundColor[1], foregroundColor[3]), + calcChannel(backgroundColor[2], foregroundColor[2], foregroundColor[3]), + ] + } + else { + return [ + foregroundColor[0], + foregroundColor[1], + foregroundColor[2], + ] + } +} + +/** + * PostCSS plugin to transform rgba() to hexadecimal + */ +module.exports = postcss.plugin("postcss-color-rgba-fallback", +function(options) { + options = options || {} + + var properties = options.properties || [ + "background-color", + "background", + "color", + "border", + "border-color", + "outline", + "outline-color", + ] + + var backgroundColor = options.backgroundColor || null + + var oldie = options.oldie + if (oldie === true) { + oldie = [ + "background-color", + "background", + ] + } + else if (!Array.isArray(oldie)) { + oldie = false + } + + return function(style) { + style.walkDecls(function(decl) { + if (!decl.value || + decl.value.indexOf("rgba") === -1 || + properties.indexOf(decl.prop) === -1 + ) { + return + } + + // if previous prop equals current prop + // no need fallback + if ( + decl.prev() && + decl.prev().prop === decl.prop + ) { + return + } + + var hex + var alpha + var RGB + var value = valueParser(decl.value).walk(function(node) { + var nodes = node.nodes + if (node.type === "function" && node.value === "rgba") { + try { + alpha = parseFloat(nodes[6].value) + RGB = calculateRGB(backgroundColor, [ + parseInt(nodes[0].value, 10), + parseInt(nodes[2].value, 10), + parseInt(nodes[4].value, 10), + alpha, + ]) + hex = rgbToHex.apply(null, RGB) + node.type = "word" + node.value = "#" + hex + } + catch (e) { + return false + } + return false + } + }).toString() + + if (value !== decl.value) { + decl.cloneBefore({value: value}) + + if ( + oldie && oldie.indexOf(decl.prop) !== -1 && + 0 < alpha && alpha < 1 + ) { + hex = "#" + Math.round(alpha * 255).toString(16) + hex + var ieFilter = [ + "progid:DXImageTransform.Microsoft.gradient(startColorStr=", + hex, + ",endColorStr=", + hex, + ")", + ].join("") + var gteIE8 = postcss.decl({ + prop: "-ms-filter", value: "\"" + ieFilter + "\"", + }) + var ltIE8 = postcss.decl({ + prop: "filter", value: ieFilter, + }) + + decl.parent.insertBefore(decl, gteIE8) + decl.parent.insertBefore(decl, ltIE8) + } + } + }) + } +}) diff --git a/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/package.json b/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/package.json new file mode 100644 index 00000000..6b6b117e --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-color-rgba-fallback/package.json @@ -0,0 +1,38 @@ +{ + "name": "postcss-color-rgba-fallback", + "version": "3.0.0", + "description": "PostCSS plugin to transform rgba() to hexadecimal", + "keywords": [ + "css", + "postcss", + "postcss-plugin", + "rgba", + "hexadecimal" + ], + "author": "Guillaume Démésy", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/postcss/postcss-color-rgba-fallback.git" + }, + "files": [ + "CHANGELOG.md", + "LICENSE", + "index.js" + ], + "dependencies": { + "postcss": "^6.0.6", + "postcss-value-parser": "^3.3.0", + "rgb-hex": "^2.1.0" + }, + "devDependencies": { + "css-whitespace": "^1.1.0", + "eslint": "^1.10.3", + "tap-spec": "^4.1.1", + "tape": "^4.7.0" + }, + "scripts": { + "lint": "eslint . --ignore-path .gitignore", + "test": "npm run lint && tape test/*.js | tap-spec" + } +} diff --git a/node_modules/rucksack-css/node_modules/postcss-reporter/CHANGELOG.md b/node_modules/rucksack-css/node_modules/postcss-reporter/CHANGELOG.md new file mode 100644 index 00000000..97e25532 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-reporter/CHANGELOG.md @@ -0,0 +1,65 @@ +# Changelog + +## 5.0.0 + +- Move PostCSS from `peerDependencies` to `dependencies`. +- Drop support for Node 0.12. + +## 4.0.0 + +- Upgrade to PostCSS v6. (If you still use PostCSS v5, stick with v3 until you can upgrade your PostCSS.) +- Switched PostCSS to a peer dependency. + +## 3.0.0 + +- Replace `clearMessages` option with `clearReportedMessages` and `clearAllMessages`. + +## 2.0.0 + +- Only log warning messages (`type: "warning"`) by default. + +## 1.4.1 +- Add `filter` option. +- Add blacklist functionality to `plugins` option with `!` prefix`. + +## 1.3.3 +- Fix regression that caused positions from sources without incoming sourcemaps not to be logged. + +## 1.3.2 +- Find more accurate positions of preprocessed files with sourcemaps. + +## 1.3.1 +- Fix Windows path bug. + +## 1.3.0 +- Check individual messages for distinct sources, then group messages by those sources, + instead of always using the PostCSS Result's source. +- Output empty string from `formatter` if there are no messages, instead of `undefined`. + +## 1.2.1 +- Handle variable and absent input sources. + +## 1.2.0 +- Add `noIcon` and `noPlugin` options to both reporter and formatter. + +## 1.1.0 +- Use PostCSS 5's line/column properties on warnings, instead of relying on the source node. + +## 1.0.0 +- Upgrade to PostCSS 5. + +## 0.4.0 +- Add `positionless` option (to both the reporter and the formatter), with default value `"first"`. +- Cleaner npm install (files specified in `package.json`). + +## 0.3.1 +- Remove leftover debugging log statement. + +## 0.3.0 +- Add `sortByPosition` option (to both the reporter and the formatter), with default value `true`. + +## 0.2.0 +- Alter `defaultFormatter` to use warning symbol and not repeat `# postcss-reporter`. + +## 0.1.0 +- First release. diff --git a/node_modules/rucksack-css/node_modules/postcss-reporter/LICENSE b/node_modules/rucksack-css/node_modules/postcss-reporter/LICENSE new file mode 100644 index 00000000..6d347c06 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-reporter/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 David Clark + +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. + diff --git a/node_modules/rucksack-css/node_modules/postcss-reporter/README.md b/node_modules/rucksack-css/node_modules/postcss-reporter/README.md new file mode 100644 index 00000000..6842f131 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-reporter/README.md @@ -0,0 +1,143 @@ +# postcss-reporter +[![Build Status](https://travis-ci.org/postcss/postcss-reporter.svg?branch=master)](https://travis-ci.org/postcss/postcss-reporter) +[![AppVeyor Build Status](https://img.shields.io/appveyor/ci/davidtheclark/postcss-reporter/master.svg?label=windows%20build)](https://ci.appveyor.com/project/davidtheclark/postcss-reporter) + +A PostCSS plugin to `console.log()` the messages (warnings, etc.) registered by other PostCSS plugins. + +## Purpose + +As of PostCSS 4.1, a single PostCSS process can accumulate messages from all of the plugins it uses. +Most of these messages are [warnings](https://github.com/postcss/postcss/blob/master/docs/guidelines/plugin.md#32-use-resultwarn-for-warnings). +Presumably, plugin authors want you to see those messages. +So this plugin exists to read the accumulated messages (or messages from only the plugins you've specified), format them, and print them to the console. + +By default, the messages are formatted for human legibility and sorted according to the line/column positions attached to the messages. But another formatting function can be passed in with an option, and sorting can be turned of with an option. + +*By default, only warnings are logged*. If you would like to see more messages, you can change the `filter` function. + +## Example Output + +![Example](example.png?raw=true) + +## Installation + +``` +npm install postcss-reporter +``` + +Version 1.0.0+ is compatible with PostCSS 5+. (Earlier versions are compatible with PostCSS 4.) + +## Usage + +Add it to your plugin list *after any plugins whose messages you want to log*, and optionally pass it an object of options. + +For example, using [gulp-postcss](https://github.com/postcss/gulp-postcss): + +```js +gulp.task('css', function() { + return gulp.src('./src/*.css') + .pipe(postcss([ + bemLinter(), + customProperties(), + calc(), + rejectAllColors(), + reporter(myOptions) // <------ ding + ])) + .pipe(gulp.dest('./dist')); +}); +``` + +## Options + +**clearReportedMessages** (boolean, default = `false`) + +If true, the plugin will clear the result's messages after it logs them. This prevents other plugins, or the whatever runner you use, from logging the same information again and causing confusion. + +**formatter** (function, default = the default formatter) + +By default, this reporter will format the messages for human legibility in the console. +To use another formatter, pass a function that + + - accepts an object containing a `messages` array and a `source` string + - returns the string to report + +For example, you could write a formatter like this: + +```js +reporter({ + formatter: function(input) { + return input.source + ' produced ' + input.messages.length + ' messages'; + } +}) +``` + +**plugins** (array of strings, default = `[]`) + +If `plugins` is empty (as it is by default), the reporter will log messages from every PostCSS plugin. + +There are 2 ways to limit output: + +- **Whitelist:** Provide an array of the plugins whose messages you would like to show. + For example, `{ plugins: ['postcss-bem-linter'] }` will only log messages from the `postcss-bem-linter` plugin. +- **Blacklist:** Prefix all plugins in the array with `!` to specify only those plugins whose messages you would like to hide. + (All other plugins will be shown.) + For example, `{ plugins: ['!postcss-bem-linter'] }` will never log messages from the `postcss-bem-linter` plugin; but will log messages from every other plugin. + +**filter** (function) + +Provide a filter function. It receives the message object and returns a truthy or falsy value, indicating whether that particular message should be reported or not. + +By default, only messages with `type: "warning"` warnings are logged. (These are the messages produced when the plugin author uses PostCSS's `warn()` function.) + +For example, `function(message) { return true }` will only every message, regardless of the plugin or whether it's a warning or not. + +**clearAllMessages** (boolean, default = `false`) + +If `true`, not pass any messages into other plugins, or the whatever runner you use, for logging. + +**throwError** (boolean, default = `false`) + +If `true`, after the plugin logs your messages it will throw an error if it found any warnings. + +**sortByPosition** (boolean, default = `true`) + +If `false`, messages will not be sorted by line/column position. + +**positionless** (`"first"|"last"|"any"`, default = `"first"`) + +By default, messages without line/column positions will be grouped at the beginning of the output. +To put them at the end, instead, use `"last"`. +To not bother sorting these, use `"any"`. + +**noIcon** (boolean, default = `false`) + +If `true`, no exclamatory triangle icons will be printed next to warnings. + +**noPlugin** (boolean, default = `false`) + +If `true`, plugin names will not be printed in brackets after messages. + +## How to get output without colors + +If you would like no colors in the console output, simply pass `--no-colors` when you invoke whatever command runs this plugin. (This works because of [chalk](https://github.com/sindresorhus/chalk).) + +## Standalone formatter + +You can also use this module's formatter as a library, with following API: + +```js +var formatter = require('postcss-reporter/lib/formatter'); +var myFormatter = formatter(myOptions); +// to use defaults, just pass no options: `formatter()` +var warningLog = myFormatter({ + messages: someMessages, + source: someSource +}); +console.log(warningLog); +``` + +These are the formatter's options: + +- sortByPosition (boolean, default = `true`) +- noIcon (boolean, default = `false`) - Do not print any warning exclamatory triangle icons +- noPlugin (boolean, default = `false`) - Do not print plugin names diff --git a/node_modules/rucksack-css/node_modules/postcss-reporter/index.js b/node_modules/rucksack-css/node_modules/postcss-reporter/index.js new file mode 100644 index 00000000..2a4e4136 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-reporter/index.js @@ -0,0 +1,4 @@ +var postcss = require('postcss'); +var reporter = require('./lib/reporter'); + +module.exports = postcss.plugin('postcss-reporter', reporter); diff --git a/node_modules/rucksack-css/node_modules/postcss-reporter/lib/formatter.js b/node_modules/rucksack-css/node_modules/postcss-reporter/lib/formatter.js new file mode 100644 index 00000000..b5719b8f --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-reporter/lib/formatter.js @@ -0,0 +1,80 @@ +var chalk = require('chalk'); +var path = require('path'); +var symbols = require('log-symbols'); +var _ = require('lodash'); +var util = require('./util'); + +module.exports = function(opts) { + var options = opts || {}; + var sortByPosition = (typeof options.sortByPosition !== 'undefined') ? options.sortByPosition : true; + var positionless = options.positionless || 'first'; + + return function(input) { + var messages = input.messages; + var source = input.source; + + if (!messages.length) return ''; + + var orderedMessages = _.sortBy( + messages, + function(m) { + if (!m.line) return 1; + if (positionless === 'any') return 1; + if (positionless === 'first') return 2; + if (positionless === 'last') return 0; + }, + function(m) { + if (!sortByPosition) return 1; + return m.line; + }, + function(m) { + if (!sortByPosition) return 1; + return m.column; + } + ); + + var output = '\n'; + + if (source) { + output += chalk.bold.underline(logFrom(source)) + '\n'; + } + + orderedMessages.forEach(function(w) { + output += messageToString(w) + '\n'; + }); + + return output; + + function messageToString(message) { + var location = util.getLocation(message); + var str = ''; + + if (location.line) { + str += chalk.bold(location.line); + } + + if (location.column) { + str += chalk.bold(':' + location.column) + } + + if (location.line || location.column) { + str += '\t'; + } + + if (!options.noIcon && message.type === 'warning') { + str += chalk.yellow(symbols.warning + ' '); + } + + str += message.text; + if (!options.noPlugin) { + str += chalk.yellow(' [' + message.plugin + ']'); + } + return str; + } + + function logFrom(fromValue) { + if (fromValue.charAt(0) === '<') return fromValue; + return path.relative(process.cwd(), fromValue).split(path.sep).join('/'); + } + }; +}; diff --git a/node_modules/rucksack-css/node_modules/postcss-reporter/lib/reporter.js b/node_modules/rucksack-css/node_modules/postcss-reporter/lib/reporter.js new file mode 100644 index 00000000..70781fba --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-reporter/lib/reporter.js @@ -0,0 +1,81 @@ +var chalk = require('chalk'); +var _ = require('lodash'); +var defaultFormatter = require('./formatter'); +var util = require('./util'); + +module.exports = function(opts) { + var options = opts || {}; + + var formatter = options.formatter || defaultFormatter({ + sortByPosition: (typeof options.sortByPosition !== 'undefined') ? options.sortByPosition : true, + positionless: options.positionless || 'first', + noIcon: options.noIcon, + noPlugin: options.noPlugin, + }); + + var pluginFilter; + if (!options.plugins) { + // Every plugin + pluginFilter = function() { return true; }; + } else if (options.plugins.every(function(plugin) { return plugin[0] === '!'; })) { + // Blacklist + pluginFilter = function(message) { + return options.plugins.indexOf('!' + message.plugin) === -1; + }; + } else { + // Whitelist + pluginFilter = function(message) { + return options.plugins.indexOf(message.plugin) !== -1; + }; + } + + var messageFilter = options.filter || function(message) { return (message.type === 'warning'); }; + + return function(css, result) { + var messagesToLog = result.messages + .filter(pluginFilter) + .filter(messageFilter); + + var resultSource = (!result.root.source) ? '' + : result.root.source.input.file || result.root.source.input.id + + var sourceGroupedMessages = _.groupBy(messagesToLog, function(message) { + return util.getLocation(message).file || resultSource; + }); + + var report = ''; + _.forOwn(sourceGroupedMessages, function(messages, source) { + report += formatter({ + messages: messages, + source: source, + }); + }); + + if (options.clearReportedMessages) { + result.messages = _.difference(result.messages, messagesToLog); + } + + if (options.clearAllMessages) { + var messagesToClear = result.messages.filter(pluginFilter); + result.messages = _.difference(result.messages, messagesToClear); + } + + + if (!report) return; + + console.log(report); + + if (options.throwError && shouldThrowError()) { + throw new Error(chalk.red.bold('\n** postcss-reporter: warnings or errors were found **')); + } + + function shouldThrowError() { + return ( + messagesToLog.length + && messagesToLog.some(function(message) { + return message.type === 'warning' || message.type === 'error'; + }) + ); + } + }; +}; diff --git a/node_modules/rucksack-css/node_modules/postcss-reporter/lib/util.js b/node_modules/rucksack-css/node_modules/postcss-reporter/lib/util.js new file mode 100644 index 00000000..76c649bc --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-reporter/lib/util.js @@ -0,0 +1,20 @@ +var _ = require('lodash'); + +exports.getLocation = function(message) { + var messageNode = message.node; + + var location = { + line: message.line, + column: message.column, + }; + + var messageInput = _.get(messageNode, 'source.input'); + + if (!messageInput) return location; + + var originLocation = messageInput.origin && messageInput.origin(message.line, message.column) + if (originLocation) return originLocation + + location.file = messageInput.file || messageInput.id; + return location; +}; diff --git a/node_modules/rucksack-css/node_modules/postcss-reporter/package.json b/node_modules/rucksack-css/node_modules/postcss-reporter/package.json new file mode 100644 index 00000000..7233b6f0 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-reporter/package.json @@ -0,0 +1,46 @@ +{ + "name": "postcss-reporter", + "version": "5.0.0", + "description": "Log PostCSS messages in the console", + "main": "index.js", + "scripts": { + "lint": "eslint .", + "test": "npm run lint && tape test", + "visual": "node test/visual.js" + }, + "files": [ + "index.js", + "lib" + ], + "repository": { + "type": "git", + "url": "https://github.com/postcss/postcss-reporter.git" + }, + "author": { + "name": "David Clark", + "email": "david.dave.clark@gmail.com", + "url": "http://davidtheclark.com" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/postcss/postcss-reporter/issues" + }, + "homepage": "https://github.com/postcss/postcss-reporter", + "devDependencies": { + "eslint": "1.3.1", + "less": "2.7.1", + "source-map": "0.5.6", + "strip-color": "^0.1.0", + "stylelint": "6.8.0", + "tape": "^4.7.0" + }, + "dependencies": { + "chalk": "^2.0.1", + "lodash": "^4.17.4", + "log-symbols": "^2.0.0", + "postcss": "^6.0.8" + }, + "engines": { + "node": ">=4" + } +} diff --git a/node_modules/rucksack-css/node_modules/postcss-value-parser/LICENSE b/node_modules/rucksack-css/node_modules/postcss-value-parser/LICENSE new file mode 100644 index 00000000..6dcaefcb --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-value-parser/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) Bogdan Chadkin + +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. diff --git a/node_modules/rucksack-css/node_modules/postcss-value-parser/README.md b/node_modules/rucksack-css/node_modules/postcss-value-parser/README.md new file mode 100644 index 00000000..0f3be478 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-value-parser/README.md @@ -0,0 +1,253 @@ +# postcss-value-parser + +[![Travis CI](https://travis-ci.org/TrySound/postcss-value-parser.svg)](https://travis-ci.org/TrySound/postcss-value-parser) + +Transforms CSS declaration values and at-rule parameters into a tree of nodes, and provides a simple traversal API. + +## Usage + +```js +var valueParser = require('postcss-value-parser'); +var cssBackgroundValue = 'url(foo.png) no-repeat 40px 73%'; +var parsedValue = valueParser(cssBackgroundValue); +// parsedValue exposes an API described below, +// e.g. parsedValue.walk(..), parsedValue.toString(), etc. +``` + +For example, parsing the value `rgba(233, 45, 66, .5)` will return the following: + +```js +{ + nodes: [ + { + type: 'function', + value: 'rgba', + before: '', + after: '', + nodes: [ + { type: 'word', value: '233' }, + { type: 'div', value: ',', before: '', after: ' ' }, + { type: 'word', value: '45' }, + { type: 'div', value: ',', before: '', after: ' ' }, + { type: 'word', value: '66' }, + { type: 'div', value: ',', before: ' ', after: '' }, + { type: 'word', value: '.5' } + ] + } + ] +} +``` + +If you wanted to convert each `rgba()` value in `sourceCSS` to a hex value, you could do so like this: + +```js +var valueParser = require('postcss-value-parser'); + +var parsed = valueParser(sourceCSS); + +// walk() will visit all the of the nodes in the tree, +// invoking the callback for each. +parsed.walk(function (node) { + + // Since we only want to transform rgba() values, + // we can ignore anything else. + if (node.type !== 'function' && node.value !== 'rgba') return; + + // We can make an array of the rgba() arguments to feed to a + // convertToHex() function + var color = node.nodes.filter(function (node) { + return node.type === 'word'; + }).map(function (node) { + return Number(node.value); + }); // [233, 45, 66, .5] + + // Now we will transform the existing rgba() function node + // into a word node with the hex value + node.type = 'word'; + node.value = convertToHex(color); +}) + +parsed.toString(); // #E92D42 +``` + +## Nodes + +Each node is an object with these common properties: + +- **type**: The type of node (`word`, `string`, `div`, `space`, `comment`, or `function`). + Each type is documented below. +- **value**: Each node has a `value` property; but what exactly `value` means + is specific to the node type. Details are documented for each type below. +- **sourceIndex**: The starting index of the node within the original source + string. For example, given the source string `10px 20px`, the `word` node + whose value is `20px` will have a `sourceIndex` of `5`. + +### word + +The catch-all node type that includes keywords (e.g. `no-repeat`), +quantities (e.g. `20px`, `75%`, `1.5`), and hex colors (e.g. `#e6e6e6`). + +Node-specific properties: + +- **value**: The "word" itself. + +### string + +A quoted string value, e.g. `"something"` in `content: "something";`. + +Node-specific properties: + +- **value**: The text content of the string. +- **quote**: The quotation mark surrounding the string, either `"` or `'`. +- **unclosed**: `true` if the string was not closed properly. e.g. `"unclosed string `. + +### div + +A divider, for example + +- `,` in `animation-duration: 1s, 2s, 3s` +- `/` in `border-radius: 10px / 23px` +- `:` in `(min-width: 700px)` + +Node-specific properties: + +- **value**: The divider character. Either `,`, `/`, or `:` (see examples above). +- **before**: Whitespace before the divider. +- **after**: Whitespace after the divider. + +### space + +Whitespace used as a separator, e.g. ` ` occurring twice in `border: 1px solid black;`. + +Node-specific properties: + +- **value**: The whitespace itself. + +### comment + +A CSS comment starts with `/*` and ends with `*/` + +Node-specific properties: + +- **value**: The comment value without `/*` and `*/` +- **unclosed**: `true` if the comment was not closed properly. e.g. `/* comment without an end `. + +### function + +A CSS function, e.g. `rgb(0,0,0)` or `url(foo.bar)`. + +Function nodes have nodes nested within them: the function arguments. + +Additional properties: + +- **value**: The name of the function, e.g. `rgb` in `rgb(0,0,0)`. +- **before**: Whitespace after the opening parenthesis and before the first argument, + e.g. ` ` in `rgb( 0,0,0)`. +- **after**: Whitespace before the closing parenthesis and after the last argument, + e.g. ` ` in `rgb(0,0,0 )`. +- **nodes**: More nodes representing the arguments to the function. +- **unclosed**: `true` if the parentheses was not closed properly. e.g. `( unclosed-function `. + +Media features surrounded by parentheses are considered functions with an +empty value. For example, `(min-width: 700px)` parses to these nodes: + +```js +[ + { + type: 'function', value: '', before: '', after: '', + nodes: [ + { type: 'word', value: 'min-width' }, + { type: 'div', value: ':', before: '', after: ' ' }, + { type: 'word', value: '700px' } + ] + } +] +``` + +`url()` functions can be parsed a little bit differently depending on +whether the first character in the argument is a quotation mark. + +`url( /gfx/img/bg.jpg )` parses to: + +```js +{ type: 'function', sourceIndex: 0, value: 'url', before: ' ', after: ' ', nodes: [ + { type: 'word', sourceIndex: 5, value: '/gfx/img/bg.jpg' } +] } +``` + +`url( "/gfx/img/bg.jpg" )`, on the other hand, parses to: + +```js +{ type: 'function', sourceIndex: 0, value: 'url', before: ' ', after: ' ', nodes: [ + type: 'string', sourceIndex: 5, quote: '"', value: '/gfx/img/bg.jpg' }, +] } +``` + +## API + +``` +var valueParser = require('postcss-value-parser'); +``` + +### valueParser.unit(quantity) + +Parses `quantity`, distinguishing the number from the unit. Returns an object like the following: + +```js +// Given 2rem +{ + number: '2', + unit: 'rem' +} +``` + +If the `quantity` argument cannot be parsed as a number, returns `false`. + +*This function does not parse complete values*: you cannot pass it `1px solid black` and expect `px` as +the unit. Instead, you should pass it single quantities only. Parse `1px solid black`, then pass it +the stringified `1px` node (a `word` node) to parse the number and unit. + +### valueParser.stringify(nodes[, custom]) + +Stringifies a node or array of nodes. + +The `custom` function is called for each `node`; return a string to override the default behaviour. + +### valueParser.walk(nodes, callback[, bubble]) + +Walks each provided node, recursively walking all descendent nodes within functions. + +Returning `false` in the `callback` will prevent traversal of descendent nodes (within functions). +You can use this feature to for shallow iteration, walking over only the *immediate* children. +*Note: This only applies if `bubble` is `false` (which is the default).* + +By default, the tree is walked from the outermost node inwards. +To reverse the direction, pass `true` for the `bubble` argument. + +The `callback` is invoked with three arguments: `callback(node, index, nodes)`. + +- `node`: The current node. +- `index`: The index of the current node. +- `nodes`: The complete nodes array passed to `walk()`. + +Returns the `valueParser` instance. + +### var parsed = valueParser(value) + +Returns the parsed node tree. + +### parsed.nodes + +The array of nodes. + +### parsed.toString() + +Stringifies the node tree. + +### parsed.walk(callback[, bubble]) + +Walks each node inside `parsed.nodes`. See the documentation for `valueParser.walk()` above. + +# License + +MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru) diff --git a/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/index.js b/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/index.js new file mode 100644 index 00000000..f9ac0e68 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/index.js @@ -0,0 +1,28 @@ +var parse = require("./parse"); +var walk = require("./walk"); +var stringify = require("./stringify"); + +function ValueParser(value) { + if (this instanceof ValueParser) { + this.nodes = parse(value); + return this; + } + return new ValueParser(value); +} + +ValueParser.prototype.toString = function() { + return Array.isArray(this.nodes) ? stringify(this.nodes) : ""; +}; + +ValueParser.prototype.walk = function(cb, bubble) { + walk(this.nodes, cb, bubble); + return this; +}; + +ValueParser.unit = require("./unit"); + +ValueParser.walk = walk; + +ValueParser.stringify = stringify; + +module.exports = ValueParser; diff --git a/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/parse.js b/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/parse.js new file mode 100644 index 00000000..50d1fe9c --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/parse.js @@ -0,0 +1,251 @@ +var openParentheses = "(".charCodeAt(0); +var closeParentheses = ")".charCodeAt(0); +var singleQuote = "'".charCodeAt(0); +var doubleQuote = '"'.charCodeAt(0); +var backslash = "\\".charCodeAt(0); +var slash = "/".charCodeAt(0); +var comma = ",".charCodeAt(0); +var colon = ":".charCodeAt(0); +var star = "*".charCodeAt(0); + +module.exports = function(input) { + var tokens = []; + var value = input; + + var next, quote, prev, token, escape, escapePos, whitespacePos; + var pos = 0; + var code = value.charCodeAt(pos); + var max = value.length; + var stack = [{ nodes: tokens }]; + var balanced = 0; + var parent; + + var name = ""; + var before = ""; + var after = ""; + + while (pos < max) { + // Whitespaces + if (code <= 32) { + next = pos; + do { + next += 1; + code = value.charCodeAt(next); + } while (code <= 32); + token = value.slice(pos, next); + + prev = tokens[tokens.length - 1]; + if (code === closeParentheses && balanced) { + after = token; + } else if (prev && prev.type === "div") { + prev.after = token; + } else if ( + code === comma || + code === colon || + (code === slash && value.charCodeAt(next + 1) !== star) + ) { + before = token; + } else { + tokens.push({ + type: "space", + sourceIndex: pos, + value: token + }); + } + + pos = next; + + // Quotes + } else if (code === singleQuote || code === doubleQuote) { + next = pos; + quote = code === singleQuote ? "'" : '"'; + token = { + type: "string", + sourceIndex: pos, + quote: quote + }; + do { + escape = false; + next = value.indexOf(quote, next + 1); + if (~next) { + escapePos = next; + while (value.charCodeAt(escapePos - 1) === backslash) { + escapePos -= 1; + escape = !escape; + } + } else { + value += quote; + next = value.length - 1; + token.unclosed = true; + } + } while (escape); + token.value = value.slice(pos + 1, next); + + tokens.push(token); + pos = next + 1; + code = value.charCodeAt(pos); + + // Comments + } else if (code === slash && value.charCodeAt(pos + 1) === star) { + token = { + type: "comment", + sourceIndex: pos + }; + + next = value.indexOf("*/", pos); + if (next === -1) { + token.unclosed = true; + next = value.length; + } + + token.value = value.slice(pos + 2, next); + tokens.push(token); + + pos = next + 2; + code = value.charCodeAt(pos); + + // Dividers + } else if (code === slash || code === comma || code === colon) { + token = value[pos]; + + tokens.push({ + type: "div", + sourceIndex: pos - before.length, + value: token, + before: before, + after: "" + }); + before = ""; + + pos += 1; + code = value.charCodeAt(pos); + + // Open parentheses + } else if (openParentheses === code) { + // Whitespaces after open parentheses + next = pos; + do { + next += 1; + code = value.charCodeAt(next); + } while (code <= 32); + token = { + type: "function", + sourceIndex: pos - name.length, + value: name, + before: value.slice(pos + 1, next) + }; + pos = next; + + if (name === "url" && code !== singleQuote && code !== doubleQuote) { + next -= 1; + do { + escape = false; + next = value.indexOf(")", next + 1); + if (~next) { + escapePos = next; + while (value.charCodeAt(escapePos - 1) === backslash) { + escapePos -= 1; + escape = !escape; + } + } else { + value += ")"; + next = value.length - 1; + token.unclosed = true; + } + } while (escape); + // Whitespaces before closed + whitespacePos = next; + do { + whitespacePos -= 1; + code = value.charCodeAt(whitespacePos); + } while (code <= 32); + if (pos !== whitespacePos + 1) { + token.nodes = [ + { + type: "word", + sourceIndex: pos, + value: value.slice(pos, whitespacePos + 1) + } + ]; + } else { + token.nodes = []; + } + if (token.unclosed && whitespacePos + 1 !== next) { + token.after = ""; + token.nodes.push({ + type: "space", + sourceIndex: whitespacePos + 1, + value: value.slice(whitespacePos + 1, next) + }); + } else { + token.after = value.slice(whitespacePos + 1, next); + } + pos = next + 1; + code = value.charCodeAt(pos); + tokens.push(token); + } else { + balanced += 1; + token.after = ""; + tokens.push(token); + stack.push(token); + tokens = token.nodes = []; + parent = token; + } + name = ""; + + // Close parentheses + } else if (closeParentheses === code && balanced) { + pos += 1; + code = value.charCodeAt(pos); + + parent.after = after; + after = ""; + balanced -= 1; + stack.pop(); + parent = stack[balanced]; + tokens = parent.nodes; + + // Words + } else { + next = pos; + do { + if (code === backslash) { + next += 1; + } + next += 1; + code = value.charCodeAt(next); + } while ( + next < max && + !( + code <= 32 || + code === singleQuote || + code === doubleQuote || + code === comma || + code === colon || + code === slash || + code === openParentheses || + (code === closeParentheses && balanced) + ) + ); + token = value.slice(pos, next); + + if (openParentheses === code) { + name = token; + } else { + tokens.push({ + type: "word", + sourceIndex: pos, + value: token + }); + } + + pos = next; + } + } + + for (pos = stack.length - 1; pos; pos -= 1) { + stack[pos].unclosed = true; + } + + return stack[0].nodes; +}; diff --git a/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/stringify.js b/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/stringify.js new file mode 100644 index 00000000..5f2c845a --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/stringify.js @@ -0,0 +1,48 @@ +function stringifyNode(node, custom) { + var type = node.type; + var value = node.value; + var buf; + var customResult; + + if (custom && (customResult = custom(node)) !== undefined) { + return customResult; + } else if (type === "word" || type === "space") { + return value; + } else if (type === "string") { + buf = node.quote || ""; + return buf + value + (node.unclosed ? "" : buf); + } else if (type === "comment") { + return "/*" + value + (node.unclosed ? "" : "*/"); + } else if (type === "div") { + return (node.before || "") + value + (node.after || ""); + } else if (Array.isArray(node.nodes)) { + buf = stringify(node.nodes); + if (type !== "function") { + return buf; + } + return ( + value + + "(" + + (node.before || "") + + buf + + (node.after || "") + + (node.unclosed ? "" : ")") + ); + } + return value; +} + +function stringify(nodes, custom) { + var result, i; + + if (Array.isArray(nodes)) { + result = ""; + for (i = nodes.length - 1; ~i; i -= 1) { + result = stringifyNode(nodes[i], custom) + result; + } + return result; + } + return stringifyNode(nodes, custom); +} + +module.exports = stringify; diff --git a/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/unit.js b/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/unit.js new file mode 100644 index 00000000..06a1f667 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/unit.js @@ -0,0 +1,49 @@ +var minus = "-".charCodeAt(0); +var plus = "+".charCodeAt(0); +var dot = ".".charCodeAt(0); +var exp = "e".charCodeAt(0); +var EXP = "E".charCodeAt(0); + +module.exports = function(value) { + var pos = 0; + var length = value.length; + var dotted = false; + var sciPos = -1; + var containsNumber = false; + var code; + + while (pos < length) { + code = value.charCodeAt(pos); + + if (code >= 48 && code <= 57) { + containsNumber = true; + } else if (code === exp || code === EXP) { + if (sciPos > -1) { + break; + } + sciPos = pos; + } else if (code === dot) { + if (dotted) { + break; + } + dotted = true; + } else if (code === plus || code === minus) { + if (pos !== 0) { + break; + } + } else { + break; + } + + pos += 1; + } + + if (sciPos + 1 === pos) pos--; + + return containsNumber + ? { + number: value.slice(0, pos), + unit: value.slice(pos) + } + : false; +}; diff --git a/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/walk.js b/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/walk.js new file mode 100644 index 00000000..7666c5b1 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-value-parser/lib/walk.js @@ -0,0 +1,22 @@ +module.exports = function walk(nodes, cb, bubble) { + var i, max, node, result; + + for (i = 0, max = nodes.length; i < max; i += 1) { + node = nodes[i]; + if (!bubble) { + result = cb(node, i, nodes); + } + + if ( + result !== false && + node.type === "function" && + Array.isArray(node.nodes) + ) { + walk(node.nodes, cb, bubble); + } + + if (bubble) { + cb(node, i, nodes); + } + } +}; diff --git a/node_modules/rucksack-css/node_modules/postcss-value-parser/package.json b/node_modules/rucksack-css/node_modules/postcss-value-parser/package.json new file mode 100644 index 00000000..14ae1dc7 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss-value-parser/package.json @@ -0,0 +1,58 @@ +{ + "name": "postcss-value-parser", + "version": "3.3.1", + "description": "Transforms css values and at-rule params into the tree", + "main": "lib/index.js", + "files": [ + "lib" + ], + "devDependencies": { + "eslint": "^5.6.1", + "husky": "^1.0.0", + "lint-staged": "^7.3.0", + "prettier": "^1.4.4", + "tap-spec": "^5.0.0", + "tape": "^4.2.0" + }, + "scripts": { + "lint:prettier": "prettier '**/*.js' --list-different", + "lint:js": "eslint . --cache", + "lint": "yarn lint:js && yarn lint:prettier", + "pretest": "yarn lint", + "test": "tape test/*.js | tap-spec" + }, + "eslintConfig": { + "env": { + "es6": true, + "node": true + }, + "extends": "eslint:recommended" + }, + "lint-staged": { + "*.js": [ + "eslint", + "prettier --write", + "git add" + ] + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "author": "Bogdan Chadkin ", + "license": "MIT", + "homepage": "https://github.com/TrySound/postcss-value-parser", + "repository": { + "type": "git", + "url": "https://github.com/TrySound/postcss-value-parser.git" + }, + "keywords": [ + "postcss", + "value", + "parser" + ], + "bugs": { + "url": "https://github.com/TrySound/postcss-value-parser/issues" + } +} diff --git a/node_modules/rucksack-css/node_modules/postcss/CHANGELOG.md b/node_modules/rucksack-css/node_modules/postcss/CHANGELOG.md new file mode 100644 index 00000000..e2cd381e --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss/CHANGELOG.md @@ -0,0 +1,552 @@ +# Change Log +This project adheres to [Semantic Versioning](http://semver.org/). + +## 6.0.23 +* Fix parsing nested at-rules without semicolon, params, and spaces. + +## 6.0.22 +* Fix `Node#prev` and `Node#next` on missed parent. + +## 6.0.21 +* Rename Chinese docs to fix `yarnpkg.com` issue. + +## 6.0.20 +* Better error message on `null` as input CSS. + +## 6.0.19 +* Fix TypeScript definitions for source maps (by Oleh Kuchuk). +* Fix `source` field in TypeScript definitions (by Sylvain Pollet-Villard). + +## 6.0.18 +* Use primitive object in TypeScript definitions (by Sylvain Pollet-Villard). + +## 6.0.17 +* Fix parsing comment in selector between word tokens (by Oleh Kuchuk). + +## 6.0.16 +* Fix warning text (by Michael Keller). + +## 6.0.15 +* Add warning about missed `from` option on `process().then()` call. +* Add IE 10 support. + +## 6.0.14 +* Fix TypeScript definitions (by Jed Mao). + +## 6.0.13 +* Fix TypeScript definitions for case of multiple PostCSS versions + in `node_modules` (by Chris Eppstein). +* Use `source-map` 0.6. + +## 6.0.12 +* Don’t copy `*` hack to declaration indent. + +## 6.0.11 +* Add upper case `!IMPORTANT` support. + +## 6.0.10 +* Reduce PostCSS size in webpack bundle. + +## 6.0.9 +* Improve error message for plugin with old PostCSS (by Igor Adamenko). + +## 6.0.8 +* Fix Node.js 4.2.2 support. + +## 6.0.7 +* Fix base64 decoding for old Node.js and browser. + +## 6.0.6 +* Fix `end` position in at-rule without semicolon (by Oleh Kuchuk). + +## 6.0.5 +* Move Babel config from `package.json` for `node_modules` compiling cases. + +## 6.0.4 +* Fix parsing `;;` after rules. +* Use Chalk 2.0. + +## 6.0.3 +* Fix escape sequences parsing (by Oleh Kuchuk). +* Added ability to force disable colors with an environment variable. +* Improved color detection of some terminal apps. + +## 6.0.2 +* Keep `raws.before` on moving `Root` children to new `Root`. + +## 6.0.1 +* Fix parser extensibility to use it in Safe Parser. + +## 6.0 “Marquis Orias” +* Remove node.js 0.12 support. +* Remove deprecated method from PostCSS 4. +* Insert methods remove child from previous parent, instead of closing. +* Insert methods and cloning doesn’t clean `raws` anymore. +* Methods `moveTo`, `moveAfter`, `moveBefore` were deprecated. +* Options was changed in `Plugin#process(css, processOptions, pluginOptions)`. +* Add stream parser to reduce memory usage (by Oleh Kuchuk). +* Add `before()`/`after()` shortcuts for `node.parent.insertBefore(node, x)`. +* Add `Rule#raws.ownSemicolon` for semicolon after templates for `@apply`. +* Use `babel-preset-env` to compile npm package. +* Remove `js-base64` from dependencies (by Roman Dvornov). +* Fix error message on single `:` in CSS. +* Move tests to Jest. +* Clean up test (by Gabriel Kalani). + +## 5.2.18 +* Fix TypeScript definitions for case of multiple PostCSS versions + in `node_modules` (by Chris Eppstein). + +## 5.2.17 +* Add `postcss-sass` suggestion to syntax error on `.sass` input. + +## 5.2.16 +* Better error on wrong argument in node constructor. + +## 5.2.15 +* Fix TypeScript definitions (by bumbleblym). + +## 5.2.14 +* Fix browser bundle building in webpack (by janschoenherr). + +## 5.2.13 +* Do not add comment to important raws. +* Fix JSDoc (by Dmitry Semigradsky). + +## 5.2.12 +* Fix typo in deprecation message (by Garet McKinley). + +## 5.2.11 +* Fix TypeScript definitions (by Jed Mao). + +## 5.2.10 +* Fix TypeScript definitions (by Jed Mao). + +## 5.2.9 +* Update TypeScript definitions (by Jed Mao). + +## 5.2.8 +* Fix error message (by Ben Briggs). + +## 5.2.7 +* Better error message on syntax object in plugins list. + +## 5.2.6 +* Fix `postcss.vendor` for values with spaces (by 刘祺). + +## 5.2.5 +* Better error message on unclosed string (by Ben Briggs). + +## 5.2.4 +* Improve terminal CSS syntax highlight (by Simon Lydell). + +## 5.2.3 +* Better color highlight in syntax error code frame. +* Fix color highlight support in old systems. + +## 5.2.2 +* Update `Processor#version`. + +## 5.2.1 +* Fix source map path for CSS without `from` option (by Michele Locati). + +## 5.2 “Duke Vapula” +* Add syntax highlight to code frame in syntax error (by Andrey Popp). +* Use Babel code frame style and size in syntax error. +* Add `[` and `]` tokens to parse `[attr=;] {}` correctly. +* Add `ignoreErrors` options to tokenizer (by Andrey Popp). +* Fix error position on tab indent (by Simon Lydell). + +## 5.1.2 +* Suggests SCSS/Less parsers on parse errors depends on file extension. + +## 5.1.1 +* Fix TypeScript definitions (by Efremov Alexey). + +## 5.1 “King and President Zagan” +* Add URI in source map support (by Mark Finger). +* Add `map.from` option (by Mark Finger). +* Add `` mappings for nodes without source (by Bogdan Chadkin). +* Add function value support to `map.prev` option (by Chris Montoro). +* Add declaration value type check in shortcut creating (by 刘祺). +* `Result#warn` now returns new created warning. +* Don’t call plugin creator in `postcss.plugin` call. +* Add source maps to PostCSS ES5 build. +* Add JSDoc to PostCSS classes. +* Clean npm package from unnecessary docs. + +## 5.0.21 +* Fix support with input source mao with `utf8` encoding name. + +## 5.0.20 +* Fix between raw value parsing (by David Clark). +* Update TypeScript definitions (by Jed Mao). +* Clean fake node.source after `append(string)`. + +## 5.0.19 +* Fix indent-based syntaxes support. + +## 5.0.18 +* Parse new lines according W3C CSS syntax specification. + +## 5.0.17 +* Fix options argument in `Node#warn` (by Ben Briggs). +* Fix TypeScript definitions (by Jed Mao). + +## 5.0.16 +* Fix CSS syntax error position on unclosed quotes. + +## 5.0.15 +* Fix `Node#clone()` on `null` value somewhere in node. + +## 5.0.14 +* Allow to use PostCSS in webpack bundle without JSON loader. + +## 5.0.13 +* Fix `index` and `word` options in `Warning#toString` (by Bogdan Chadkin). +* Fix input source content loading in errors. +* Fix map options on using `LazyResult` as input CSS. +* 100% test coverage. +* Use Babel 6. + +## 5.0.12 +* Allow passing a previous map with no mappings (by Andreas Lind). + +## 5.0.11 +* Increase plugins performance by 1.5 times. + +## 5.0.10 +* Fix warning from nodes without source. + +## 5.0.9 +* Fix source map type detection (by @asan). + +## 5.0.8 +* Fixed a missed step in `5.0.7` that caused the module to be published as + ES6 code. + +## 5.0.7 +* PostCSS now requires that node 0.12 is installed via the engines property + in package.json (by Howard Zuo). + +## 5.0.6 +* Fix parsing nested at-rule without semicolon (by Matt Drake). +* Trim `Declaration#value` (by Bogdan Chadkin). + +## 5.0.5 +* Fix multi-tokens property parsing (by Matt Drake). + +## 5.0.4 +* Fix start position in `Root#source`. +* Fix source map annotation, when CSS uses `\r\n` (by Mohammad Younes). + +## 5.0.3 +* Fix `url()` parsing. +* Fix using `selectors` in `Rule` constructor. +* Add start source to `Root` node. + +## 5.0.2 +* Fix `remove(index)` to be compatible with 4.x plugin. + +## 5.0.1 +* Fix PostCSS 4.x plugins compatibility. +* Fix type definition loading (by Jed Mao). + +## 5.0 “President Valac” +* Remove `safe` option. Move Safe Parser to separate project. +* `Node#toString` does not include `before` for root nodes. +* Remove plugin returning `Root` API. +* Remove Promise polyfill for node.js 0.10. +* Deprecate `eachInside`, `eachDecl`, `eachRule`, `eachAtRule` and `eachComment` + in favor of `walk`, `walkDecls`, `walkRules`, `walkAtRules` and `walkComments` + (by Jed Mao). +* Deprecate `Container#remove` and `Node#removeSelf` + in favor of `Container#removeChild` and `Node#remove` (by Ben Briggs). +* Deprecate `Node#replace` in favor of `replaceWith` (by Ben Briggs). +* Deprecate raw properties in favor of `Node#raws` object. +* Deprecate `Node#style` in favor of `raw`. +* Deprecate `CssSyntaxError#generated` in favor of `input`. +* Deprecate `Node#cleanStyles` in favor of `cleanRaws`. +* Deprecate `Root#prevMap` in favor of `Root.source.input.map`. +* Add `syntax`, `parser` and `stringifier` options for Custom Syntaxes. +* Add stringifier option to `Node#toString`. +* Add `Result#content` alias for non-CSS syntaxes. +* Add `plugin.process(css)` shortcut to every plugin function (by Ben Briggs). +* Add multiple nodes support to insert methods (by Jonathan Neal). +* Add `Node#warn` shortcut (by Ben Briggs). +* Add `word` and `index` options to errors and warnings (by David Clark). +* Add `line`, `column` properties to `Warning`. +* Use `supports-color` library to detect color support in error output. +* Add type definitions for TypeScript plugin developers (by Jed Mao). +* `Rule#selectors` setter detects separators. +* Add `postcss.stringify` method. +* Throw descriptive errors for incorrectly formatted plugins. +* Add docs to npm release. +* Fix `url()` parsing. +* Fix Windows support (by Jed Mao). + +## 4.1.16 +* Fix errors without stack trace. + +## 4.1.15 +* Allow asynchronous plugins to change processor plugins list (by Ben Briggs). + +## 4.1.14 +* Fix for plugins packs defined by `postcss.plugin`. + +## 4.1.13 +* Fix input inlined source maps with UTF-8 encoding. + +## 4.1.12 +* Update Promise polyfill. + +## 4.1.11 +* Fix error message on wrong plugin format. + +## 4.1.10 +* Fix Promise behavior on sync plugin errors. +* Automatically fill `plugin` field in `CssSyntaxError`. +* Fix warning message (by Ben Briggs). + +## 4.1.9 +* Speed up `node.clone()`. + +## 4.1.8 +* Accepts `Processor` instance in `postcss()` constructor too. + +## 4.1.7 +* Speed up `postcss.list` (by Bogdan Chadkin). + +## 4.1.6 +* Fix Promise behavior on parsing error. + +## 4.1.5 +* Parse at-words in declaration values. + +## 4.1.4 +* Fix Promise polyfill dependency (by Anton Yakushev and Matija Marohnić). + +## 4.1.3 +* Add Promise polyfill for node.js 0.10 and IE. + +## 4.1.2 +* List helpers can be accessed independently `var space = postcss.list.space`. + +## 4.1.1 +* Show deprecated message only once. + +## 4.1 “Marquis Andras” +* Asynchronous plugin support. +* Add warnings from plugins and `Result#messages`. +* Add `postcss.plugin()` to create plugins with a standard API. +* Insert nodes by CSS string. +* Show version warning message on error from an outdated plugin. +* Send `Result` instance to plugins as the second argument. +* Add `CssSyntaxError#plugin`. +* Add `CssSyntaxError#showSourceCode()`. +* Add `postcss.list` and `postcss.vendor` aliases. +* Add `Processor#version`. +* Parse wrong closing bracket. +* Parse `!important` statement with spaces and comments inside (by Ben Briggs). +* Throw an error on declaration without `prop` or `value` (by Philip Peterson). +* Fix source map mappings position. +* Add indexed source map support. +* Always set `error.generated`. +* Clean all source map annotation comments. + +## 4.0.6 +* Remove `babel` from released package dependencies (by Andres Suarez). + +## 4.0.5 +* Fix error message on double colon in declaration. + +## 4.0.4 +* Fix indent detection in some rare cases. + +## 4.0.3 +* Faster API with 6to5 Loose mode. +* Fix indexed source maps support. + +## 4.0.2 +* Do not copy IE hacks to code style. + +## 4.0.1 +* Add `source.input` to `Root` too. + +## 4.0 “Duke Flauros” +* Rename `Container#childs` to `nodes`. +* Rename `PostCSS#processors` to `plugins`. +* Add `Node#replaceValues()` method. +* Add `Node#moveTo()`, `moveBefore()` and `moveAfter()` methods. +* Add `Node#cloneBefore()` and `cloneAfter()` shortcuts. +* Add `Node#next()`, `prev()` and `root()` shortcuts. +* Add `Node#replaceWith()` method. +* Add `Node#error()` method. +* Add `Container#removeAll()` method. +* Add filter argument to `eachDecl()` and `eachAtRule()`. +* Add `Node#source.input` and move `source.file` or `source.id` to `input`. +* Change code indent, when node was moved. +* Better fix code style on `Rule`, `AtRule` and `Comment` nodes changes. +* Allow to create rules and at-rules by hash shortcut in append methods. +* Add class name to CSS syntax error output. + +## 3.0.7 +* Fix IE filter parsing with multiple commands. +* Safer way to consume PostCSS object as plugin (by Maxime Thirouin). + +## 3.0.6 +* Fix missing semicolon when comment comes after last declaration. +* Fix Safe Mode declaration parsing on unclosed blocks. + +## 3.0.5 +* Fix parser to support difficult cases with backslash escape and brackets. +* Add `CssSyntaxError#stack` (by Maxime Thirouin). + +## 3.0.4 +* Fix Safe Mode on unknown word before declaration. + +## 3.0.3 +* Increase tokenizer speed (by Roman Dvornov). + +## 3.0.2 +* Fix empty comment parsing. +* Fix `Root#normalize` in some inserts. + +## 3.0.1 +* Fix Rhino JS runtime support. +* Typo in deprecated warning (by Maxime Thirouin). + +## 3.0 “Marquis Andrealphus” +* New parser, which become the fastest ever CSS parser written in JavaScript. +* Parser can now parse declarations and rules in one parent (like in `@page`) + and nested declarations for plugins like `postcss-nested`. +* Child nodes array is now in `childs` property, instead of `decls` and `rules`. +* `map.inline` and `map.sourcesContent` options are now `true` by default. +* Fix iterators (`each`, `insertAfter`) on children array changes. +* Use previous source map to show origin source of CSS syntax error. +* Use 6to5 ES6 compiler, instead of ES6 Transpiler. +* Use code style for manually added rules from existing rules. +* Use `from` option from previous source map `file` field. +* Set `to` value to `from` if `to` option is missing. +* Use better node source name when missing `from` option. +* Show a syntax error when `;` is missed between declarations. +* Allow to pass `PostCSS` instance or list of plugins to `use()` method. +* Allow to pass `Result` instance to `process()` method. +* Trim Unicode BOM on source maps parsing. +* Parse at-rules without spaces like `@import"file"`. +* Better previous `sourceMappingURL` annotation comment cleaning. +* Do not remove previous `sourceMappingURL` comment on `map.annotation: false`. +* Parse nameless at-rules in Safe Mode. +* Fix source map generation for nodes without source. +* Fix next child `before` if `Root` first child got removed. + +## 2.2.6 +* Fix map generation for nodes without source (by Josiah Savary). + +## 2.2.5 +* Fix source map with BOM marker support (by Mohammad Younes). +* Fix source map paths (by Mohammad Younes). + +## 2.2.4 +* Fix `prepend()` on empty `Root`. + +## 2.2.3 +* Allow to use object shortcut in `use()` with functions like `autoprefixer`. + +## 2.2.2 +* Add shortcut to set processors in `use()` via object with `.postcss` property. + +## 2.2.1 +* Send `opts` from `Processor#process(css, opts)` to processors. + +## 2.2 “Marquis Cimeies” +* Use GNU style syntax error messages. +* Add `Node#replace` method. +* Add `CssSyntaxError#reason` property. + +## 2.1.2 +* Fix UTF-8 support in inline source map. +* Fix source map `sourcesContent` if there is no `from` and `to` options. + +## 2.1.1 +* Allow to miss `to` and `from` options for inline source maps. +* Add `Node#source.id` if file name is unknown. +* Better detect splitter between rules in CSS concatenation tools. +* Automatically clone node in insert methods. + +## 2.1 “King Amdusias” +* Change Traceur ES6 compiler to ES6 Transpiler. +* Show broken CSS line in syntax error. + +## 2.0 “King Belial” +* Project was rewritten from CoffeeScript to ES6. +* Add Safe Mode to works with live input or with hacks from legacy code. +* More safer parser to pass all hacks from Browserhacks.com. +* Use real properties instead of magic getter/setter for raw properties. + +## 1.0 “Marquis Decarabia” +* Save previous source map for each node to support CSS concatenation + with multiple previous maps. +* Add `map.sourcesContent` option to add origin content to `sourcesContent` + inside map. +* Allow to set different place of output map in annotation comment. +* Allow to use arrays and `Root` in `Container#append` and same methods. +* Add `Root#prevMap` with information about previous map. +* Allow to use latest PostCSS from GitHub by npm. +* `Result` now is lazy and it will generate output CSS only if you use `css` + or `map` property. +* Use separated `map.prev` option to set previous map. +* Rename `inlineMap` option to `map.inline`. +* Rename `mapAnnotation` option to `map.annotation`. +* `Result#map` now return `SourceMapGenerator` object, instead of string. +* Run previous map autodetect only if input CSS contains annotation comment. +* Add `map: 'inline'` shortcut for `map: { inline: true }` option. +* `Node#source.file` now will contains absolute path. +* Clean `Declaration#between` style on node clone. + +## 0.3.5 +* Allow to use `Root` or `Result` as first argument in `process()`. +* Save parsed AST to `Result#root`. + +## 0.3.4 +* Better space symbol detect to read UTF-8 BOM correctly. + +## 0.3.3 +* Remove source map hacks by using new Mozilla’s `source-map` (by Simon Lydell). + +## 0.3.2 +* Add URI encoding support for inline source maps. + +## 0.3.1 +* Fix relative paths from previous source map. +* Safer space split in `Rule#selectors` (by Simon Lydell). + +## 0.3 “Prince Seere” +* Add `Comment` node for comments between declarations or rules. +* Add source map annotation comment to output CSS. +* Allow to inline source map to annotation comment by data:uri. +* Fix source maps on Windows. +* Fix source maps for subdirectory (by Dmitry Nikitenko and Simon Lydell). +* Autodetect previous source map. +* Add `first` and `last` shortcuts to container nodes. +* Parse `!important` to separated property in `Declaration`. +* Allow to break iteration by returning `false`. +* Copy code style to new nodes. +* Add `eachInside` method to recursively iterate all nodes. +* Add `selectors` shortcut to get selectors array. +* Add `toResult` method to `Rule` to simplify work with several input files. +* Clean declaration’s `value`, rule’s `selector` and at-rule’s `params` + by storing spaces in `between` property. + +## 0.2 “Duke Dantalion” +* Add source map support. +* Add shortcuts to create nodes. +* Method `process()` now returns object with `css` and `map` keys. +* Origin CSS file option was renamed from `file` to `from`. +* Rename `Node#remove()` method to `removeSelf()` to fix name conflict. +* Node source was moved to `source` property with origin file + and node end position. +* You can set own CSS generate function. + +## 0.1 “Count Andromalius” +* Initial release. diff --git a/node_modules/rucksack-css/node_modules/postcss/CONTRIBUTING.md b/node_modules/rucksack-css/node_modules/postcss/CONTRIBUTING.md new file mode 100644 index 00000000..227caa27 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss/CONTRIBUTING.md @@ -0,0 +1,78 @@ +# Contributing Guide to PostCSS + +If you want contribute to PostCSS, there are few things that you should +be familiar with. + + +## In Case You Have Question About Using PostCSS + +* **Ask for help in [the chat]** + + If you stuck on something there is a big chance + that someone had similar problem before. + +[the chat]: https://gitter.im/postcss/postcss + + +## Adding Your Plugin to the List + +If you created or found a plugin and want to add it to PostCSS plugins list +follow this simple steps. + +PR should not change plugins defined in README it contains only favorite plugins +and moderated by PostCSS author. + +Plugins submitted by community located in [`docs/plugins`]. + +* **Keep plugins order** + + Be sure that plugin not presented yet and find suitable position + in alphabetic order for it. + But plugins with `postcss-` prefix should come first. + +* **Check spelling** + + Before submitting PR be sure that spelling check pass. + For that run command `npm test`. + If it fails with unknown word error, add it as word + to `.yaspellerrc` dictionary. + +* **Check PostCSS plugin guideline** + + Provided plugin should match plugin [guidelines]. + +- **Provide link to suggested plugin** + + Make sure your pull request description contains link to plugin + you are willing to add. + +[`docs/plugins`]: https://github.com/postcss/postcss/blob/master/docs/plugins.md +[guidelines]: https://github.com/postcss/postcss/blob/master/docs/guidelines/plugin.md + + +## TypeScript Declaration Improvements + +If you found a bug or want to add certain improvements to types declaration file + +* **Check current TypeScript styling** + + Be sure that your changes match TypeScript styling rules defined in typings file. + * We use classes for existing JS classes like `Stringifier`. + * Namespaces used for separating functions related to same subject. + * Interfaces used for defining custom types. + + Make sure you read through declaration file writing [best practices] + by TypeScript team. + +[best practices]: https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html + + +## Core Development + +If you want to add new feature or fix existed issue + +- **Become familiar with PostCSS architecture** + + For gentle intro to PostCSS architecture look through our [guide]. + +[guide]: https://github.com/postcss/postcss/blob/master/docs/architecture.md diff --git a/node_modules/rucksack-css/node_modules/postcss/LICENSE b/node_modules/rucksack-css/node_modules/postcss/LICENSE new file mode 100644 index 00000000..da057b45 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2013 Andrey Sitnik + +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. diff --git a/node_modules/rucksack-css/node_modules/postcss/README-cn.md b/node_modules/rucksack-css/node_modules/postcss/README-cn.md new file mode 100644 index 00000000..4846ed96 --- /dev/null +++ b/node_modules/rucksack-css/node_modules/postcss/README-cn.md @@ -0,0 +1,349 @@ +# PostCSS [![Gitter][chat-img]][chat] + +哲学家的石头 - PostCSS 的 logo + +[chat-img]: https://img.shields.io/badge/Gitter-Join_the_PostCSS_chat-brightgreen.svg +[chat]: https://gitter.im/postcss/postcss + +PostCSS 是一个允许使用 JS 插件转换样式的工具。 +这些插件可以检查(lint)你的 CSS,支持 CSS Variables 和 Mixins, +编译尚未被浏览器广泛支持的先进的 CSS 语法,内联图片,以及其它很多优秀的功能。 + +PostCSS 在工业界被广泛地应用,其中不乏很多有名的行业领导者,如:维基百科,Twitter,阿里巴巴, +JetBrains。PostCSS 的 [Autoprefixer] 插件是最流行的 CSS 处理工具之一。 + +PostCSS 接收一个 CSS 文件并提供了一个 API 来分析、修改它的规则(通过把 CSS 规则转换成一个[抽象语法树]的方式)。在这之后,这个 API 便可被许多[插件]利用来做有用的事情,比如寻错或自动添加 CSS vendor 前缀。 + +**Twitter 账号:** [@postcss](https://twitter.com/postcss)
+**支持 / 讨论:** [Gitter](https://gitter.im/postcss/postcss)
+ +如果需要 PostCSS 商业支持(如咨询,提升公司的前端文化, +PostCSS 插件),请联系 [Evil Martians](https://evilmartians.com/?utm_source=postcss) +邮箱 。 + +[抽象语法树]: https://zh.wikipedia.org/wiki/%E6%8A%BD%E8%B1%A1%E8%AA%9E%E6%B3%95%E6%A8%B9 +[Autoprefixer]: https://github.com/postcss/autoprefixer +[插件]: https://github.com/postcss/postcss/blob/master/README-cn.md#%E6%8F%92%E4%BB%B6 + + + 由 Evil Martians 赞助 + + +## 插件 + +截止到目前,PostCSS 有 200 多个插件。你可以在 [插件列表] 或 [搜索目录] 找到它们。 +下方的列表是我们最喜欢的插件 - 它们很好地演示了我们可以用 PostCSS 做些什么。 + +如果你有任何新的想法,[开发 PostCSS 插件] 非常简单易上手。 + +[搜索目录]: http://postcss.parts +[插件列表]: https://github.com/postcss/postcss/blob/master/docs/plugins.md + +### 解决全局 CSS 的问题 + +* [`postcss-use`] 允许你在 CSS 里明确地设置 PostCSS 插件,并且只在当前文件执行它们。 +* [`postcss-modules`] 和 [`react-css-modules`] 可以自动以组件为单位隔绝 CSS 选择器。 +* [`postcss-autoreset`] 是全局样式重置的又一个选择,它更适用于分离的组件。 +* [`postcss-initial`] 添加了 `all: initial` 的支持,重置了所有继承的样式。 +* [`cq-prolyfill`] 添加了容器查询的支持,允许添加响应于父元素宽度的样式. + +### 提前使用先进的 CSS 特性 + +* [`autoprefixer`] 添加了 vendor 浏览器前缀,它使用 Can I Use 上面的数据。 +* [`postcss-preset-env`] 允许你使用未来的 CSS 特性。 + +### 更佳的 CSS 可读性 + +* [`precss`] 囊括了许多插件来支持类似 Sass 的特性,比如 CSS 变量,套嵌,mixins 等。 +* [`postcss-sorting`] 给规则的内容以及@规则排序。 +* [`postcss-utilities`] 囊括了最常用的简写方式和书写帮助。 +* [`short`] 添加并拓展了大量的缩写属性。 + +### 图片和字体 + +* [`postcss-assets`] 可以插入图片尺寸和内联文件。 +* [`postcss-sprites`] 能生成雪碧图。 +* [`font-magician`] 生成所有在 CSS 里需要的 `@font-face` 规则。 +* [`postcss-inline-svg`] 允许你内联 SVG 并定制它的样式。 +* [`postcss-write-svg`] 允许你在 CSS 里写简单的 SVG。 + +### 提示器(Linters) + +* [`stylelint`] 是一个模块化的样式提示器。 +* [`stylefmt`] 是一个能根据 `stylelint` 规则自动优化 CSS 格式的工具。 +* [`doiuse`] 提示 CSS 的浏览器支持性,使用的数据来自于 Can I Use。 +* [`colorguard`] 帮助你保持一个始终如一的调色板。 + +### 其它 + +* [`postcss-rtl`] 在单个 CSS 文件里组合了两个方向(左到右,右到左)的样式。 +* [`cssnano`] 是一个模块化的 CSS 压缩器。 +* [`lost`] 是一个功能强大的 `calc()` 栅格系统。 +* [`rtlcss`] 镜像翻转 CSS 样式,适用于 right-to-left 的应用场景。 + +[`postcss-inline-svg`]: https://github.com/TrySound/postcss-inline-svg +[`postcss-preset-env`]: https://github.com/jonathantneal/postcss-preset-env +[`react-css-modules`]: https://github.com/gajus/react-css-modules +[`postcss-autoreset`]: https://github.com/maximkoretskiy/postcss-autoreset +[`postcss-write-svg`]: https://github.com/jonathantneal/postcss-write-svg +[`postcss-utilities`]: https://github.com/ismamz/postcss-utilities +[`postcss-initial`]: https://github.com/maximkoretskiy/postcss-initial +[`postcss-sprites`]: https://github.com/2createStudio/postcss-sprites +[`postcss-modules`]: https://github.com/outpunk/postcss-modules +[`postcss-sorting`]: https://github.com/hudochenkov/postcss-sorting +[`postcss-assets`]: https://github.com/assetsjs/postcss-assets +[开发 PostCSS 插件]: https://github.com/postcss/postcss/blob/master/docs/writing-a-plugin.md +[`font-magician`]: https://github.com/jonathantneal/postcss-font-magician +[`autoprefixer`]: https://github.com/postcss/autoprefixer +[`cq-prolyfill`]: https://github.com/ausi/cq-prolyfill +[`postcss-rtl`]: https://github.com/vkalinichev/postcss-rtl +[`postcss-use`]: https://github.com/postcss/postcss-use +[`css-modules`]: https://github.com/css-modules/css-modules +[`colorguard`]: https://github.com/SlexAxton/css-colorguard +[`stylelint`]: https://github.com/stylelint/stylelint +[`stylefmt`]: https://github.com/morishitter/stylefmt +[`cssnano`]: http://cssnano.co +[`precss`]: https://github.com/jonathantneal/precss +[`doiuse`]: https://github.com/anandthakker/doiuse +[`rtlcss`]: https://github.com/MohammadYounes/rtlcss +[`short`]: https://github.com/jonathantneal/postcss-short +[`lost`]: https://github.com/peterramsing/lost + +## 语法 + +PostCSS 可以转化样式到任意语法,不仅仅是 CSS。 +如果还没有支持你最喜欢的语法,你可以编写一个解释器以及(或者)一个 stringifier 来拓展 PostCSS。 + +* [`sugarss`] 是一个以缩进为基础的语法,类似于 Sass 和 Stylus。 +* [`postcss-syntax`] 通过文件扩展名自动切换语法。 +* [`postcss-html`] 解析类 HTML 文件里`