Skip to content

Commit

Permalink
feat(postcss-ordered-values): compress more vendor properties (#746)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Apr 30, 2019
1 parent b0f0d89 commit b479440
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:aliases": "babel-node ./util/buildAliases.js",
"build:metadata": "babel-node ./util/buildMetadata.js",
"build:site": "remark site/content/**/*.md -o && yarn build:metadata && babel-node ./util/buildSiteMarkdown.js && cd site && yarn build",
"build:integration": "babel-node ./util/buildFrameworks.js",
"build:integration": "cross-env BABEL_ENV=test babel-node ./util/buildFrameworks.js",
"pretest": "yarn lint",
"test-only": "cross-env BABEL_ENV=test ava",
"test-only:coverage": "nyc --reporter=lcov --reporter=text yarn test-only",
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions packages/postcss-ordered-values/src/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,13 @@ test(
'-webkit-animation: bounce 1s linear 2s'
);

test(
'should order animation consistently (11) (process prefixed -moz-animation)',
processCSS,
'-moz-animation: linear bounce 1s 2s',
'-moz-animation: bounce 1s linear 2s'
);

test(
'should abort ordering when a var is detected (animation)',
passthroughCSS,
Expand Down
5 changes: 2 additions & 3 deletions packages/postcss-ordered-values/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import transition from './rules/transition';

const rules = {
animation: animation,
'-webkit-animation': animation,
border: border,
'border-top': border,
'border-right': border,
Expand All @@ -22,7 +21,6 @@ const rules = {
'box-shadow': boxShadow,
'flex-flow': flexFlow,
transition: transition,
'-webkit-transition': transition,
};

/* eslint-enable */
Expand Down Expand Up @@ -61,7 +59,8 @@ export default postcss.plugin('postcss-ordered-values', () => {

css.walkDecls((decl) => {
const lowerCasedProp = decl.prop.toLowerCase();
const processor = rules[lowerCasedProp];
const normalizedProp = postcss.vendor.unprefixed(lowerCasedProp);
const processor = rules[normalizedProp];

if (!processor) {
return;
Expand Down
2 changes: 1 addition & 1 deletion util/buildFrameworks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { join } from 'path';
import glob from 'glob';
import fs from 'fs-extra';
import postcss from 'postcss';
import cssnano from '../packages/cssnano';
import cssnano from 'lerna:cssnano';
import frameworks from './frameworks';

function rebuild(pkg) {
Expand Down

0 comments on commit b479440

Please sign in to comment.