Skip to content

Commit

Permalink
Merge 84cced6 into b3179b2
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Eldevig committed Apr 8, 2017
2 parents b3179b2 + 84cced6 commit b83794b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import postcss from 'postcss';

const postcssFlexibility = postcss.plugin('postcss-flexibility', () => css => {
css.walkRules(rule => {
const isDisabled = rule.some(({prop, text}) =>
prop === '-js-display' || text === 'flexibility-disable'
const isDisabled = rule.some(({prop, text = ''}) =>
prop === '-js-display' || text.endsWith('flexibility-disable')
);

if (!isDisabled) {
Expand Down
14 changes: 14 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,17 @@ test('Don\'add "-js-display: flex" if comment "flexibility-disable" is exist', t
}`
);
});

test('Don\'add "-js-display: flex" if comment "! flexibility-disable" is exist', t => {
return run(
t,
`a {
/*! flexibility-disable */
display: flex;
}`,
`a {
/*! flexibility-disable */
display: flex;
}`
);
});

0 comments on commit b83794b

Please sign in to comment.