postcss-will-change
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -0,1 +1,4 @@ | ||
## 1.1 | ||
* Do not add `backface-visibility` if rule already has it (by Joe Lencioni). | ||
## 1.0 | ||
@@ -2,0 +5,0 @@ * Use PostCSS 5.0 API. |
@@ -6,2 +6,6 @@ var postcss = require('postcss'); | ||
css.walkDecls('will-change', function (decl) { | ||
var already = decl.parent.some(function (i) { | ||
return i.type === 'decl' && i.prop === 'backface-visibility'; | ||
}); | ||
if ( already ) return; | ||
decl.cloneBefore({ prop: 'backface-visibility', value: 'hidden' }); | ||
@@ -8,0 +12,0 @@ }); |
{ | ||
"name": "postcss-will-change", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "PostCSS plugin to insert 3D hack before will-change property", | ||
@@ -14,19 +14,17 @@ "keywords": [ | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/postcss/postcss-will-change.git" | ||
}, | ||
"repository": "postcss/postcss-will-change.git", | ||
"dependencies": { | ||
"postcss": "^5.0.2" | ||
"postcss": "^5.0.16" | ||
}, | ||
"devDependencies": { | ||
"gulp-eslint": "1.0.0", | ||
"gulp-mocha": "2.1.3", | ||
"mocha": "2.2.5", | ||
"chai": "3.2.0", | ||
"gulp": "3.9.0" | ||
"eslint-config-postcss": "2.0.0", | ||
"eslint": "2.1.0", | ||
"ava": "0.11.0" | ||
}, | ||
"scripts": { | ||
"test": "gulp" | ||
"test": "ava && eslint *.js" | ||
}, | ||
"eslintConfig": { | ||
"extends": "eslint-config-postcss/es5" | ||
} | ||
} |
@@ -9,5 +9,7 @@ # PostCSS Will Change [![Build Status][ci-img]][ci] | ||
This plugin uses `backface-visibility` to force the browser to create a new layer. | ||
This is commonly done with `transform: translateZ(0)` and `transform: translate3d(0, 0, 0)`. | ||
`backface-visibility` is used here to avoid overriding the more popular transform property. | ||
This plugin uses `backface-visibility` to force the browser to create | ||
a new layer, without overriding existing `backface-visibility` properties. | ||
This 3D CSS hack is commonly done with `transform: translateZ(0)`, | ||
but `backface-visibility` is used here to avoid overriding | ||
the more popular `transform` property. | ||
@@ -14,0 +16,0 @@ These hacks are required for browsers that do not support `will-change`. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3
12
46
0
3804
6
1
Updatedpostcss@^5.0.16