postcss-flexibility
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -7,3 +7,3 @@ var postcss = require('postcss'); | ||
var value = decl.value; | ||
if (value && value.indexOf('flex') !== -1) { | ||
if (value && value === 'flex') { | ||
decl.cloneBefore({prop: '-js-display', value: 'flex'}); | ||
@@ -10,0 +10,0 @@ } |
{ | ||
"name": "postcss-flexibility", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "PostCSS plugin for Flexibility polyfill", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"ava": "^0.8.0", | ||
"ava": "^0.10.0", | ||
"eslint": "^1.10.2", | ||
@@ -28,0 +28,0 @@ "eslint-config-xo": "^0.9.1" |
@@ -1,9 +0,12 @@ | ||
# PostCSS Flexibility [![Build Status][ci-img]][ci] | ||
# PostCSS Flexibility | ||
[PostCSS] plugin for [Flexibility](https://github.com/10up/flexibility). | ||
[![NPM version][npm-img]][npm-url] | ||
[![Build Status][travis-img]][travis-url] | ||
[![Dependency Status][daviddm-img]][daviddm-url] | ||
[![XO code style][xo-img]][xo-url] | ||
[PostCSS]: https://github.com/postcss/postcss | ||
[ci-img]: https://travis-ci.org/7rulnik/postcss-flexibility.svg | ||
[ci]: https://travis-ci.org/7rulnik/postcss-flexibility | ||
[PostCSS] plugin for [Flexibility]. | ||
```css | ||
@@ -14,3 +17,3 @@ .foo { | ||
``` | ||
will be processed to: | ||
```css | ||
@@ -36,1 +39,30 @@ .foo { | ||
See [PostCSS] docs for examples for your environment. | ||
If you use [Autoprefixer] right now, you should put postcss-flexibility after it. | ||
When [this issue](https://github.com/postcss/autoprefixer/issues/608) is closed you'll be able to put [Autoprefixer] before too. | ||
```js | ||
postcss([ | ||
require('autoprefixer'), | ||
require('postcss-flexibility') | ||
]) | ||
``` | ||
-- | ||
### License | ||
MIT © [Valentin Semirulnik](https://twitter.com/7rulnik) | ||
[PostCSS]: https://github.com/postcss/postcss | ||
[Autoprefixer]: https://github.com/postcss/autoprefixer | ||
[Flexibility]: https://github.com/10up/flexibility | ||
[travis-img]: https://travis-ci.org/7rulnik/postcss-flexibility.svg | ||
[travis-url]: https://travis-ci.org/7rulnik/postcss-flexibility | ||
[daviddm-img]: https://david-dm.org/7rulnik/postcss-flexibility.svg | ||
[daviddm-url]: https://david-dm.org/7rulnik/postcss-flexibility | ||
[npm-img]: https://badge.fury.io/js/postcss-flexibility.svg | ||
[npm-url]: https://www.npmjs.com/package/postcss-flexibility | ||
[xo-img]: https://img.shields.io/badge/code_style-XO-5ed9c7.svg | ||
[xo-url]: https://github.com/sindresorhus/xo |
@@ -15,3 +15,7 @@ import postcss from 'postcss'; | ||
test('-js-display and display', t => { | ||
return run(t, 'a { display: flex }', 'a { -js-display: flex; display: flex }'); | ||
return run( | ||
t, | ||
'a {display: -webkit-flex;display: -ms-flexbox;display: flex}', | ||
'a {display: -webkit-flex;display: -ms-flexbox;-js-display: flex;display: flex}' | ||
); | ||
}); |
4465
28
67