Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-will-change

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-will-change - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

4

CHANGELOG.md
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 4.0
* Moved to PostCSS 8.
* Moved `postcss` to `peerDependencies`.
## 3.0

@@ -5,0 +9,0 @@ * Use PostCSS 7.

27

index.js

@@ -1,13 +0,16 @@

var postcss = require('postcss')
module.exports = postcss.plugin('postcss-will-change', function () {
return function (css) {
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' })
})
module.exports = () => {
return {
postcssPlugin: 'postcss-will-change',
Declaration: {
'will-change': decl => {
let already = decl.parent.some(i => {
return i.type === 'decl' && i.prop === 'backface-visibility'
})
if (!already) {
decl.cloneBefore({ prop: 'backface-visibility', value: 'hidden' })
}
}
}
}
})
}
module.exports.postcss = true
{
"name": "postcss-will-change",
"version": "3.0.0",
"version": "4.0.0",
"description": "PostCSS plugin to insert 3D hack before will-change property",

@@ -15,5 +15,8 @@ "keywords": [

"repository": "postcss/postcss-will-change",
"dependencies": {
"postcss": "^7.0.2"
"engines": {
"node": ">=10.0"
},
"peerDependencies": {
"postcss": "^8.0.3"
}
}

@@ -1,6 +0,6 @@

# PostCSS Will Change [![Build Status][ci-img]][ci]
# PostCSS Will Change
<img align="right" width="95" height="95"
<img align="right" width="135" height="95"
title="Philosopher’s stone, logo of PostCSS"
src="http://postcss.github.io/postcss/logo.svg">
src="https://postcss.org/logo-leftp.svg">

@@ -23,8 +23,6 @@ [PostCSS] plugin to insert 3D hack before [will-change] property.

[PostCSS]: https://github.com/postcss/postcss
[ci-img]: https://travis-ci.org/postcss/postcss-will-change.svg
[ci]: https://travis-ci.org/postcss/postcss-will-change
```css
.foo {
will-change: transform;
will-change: transform;
}

@@ -35,13 +33,39 @@ ```

.foo {
backface-visibility: hidden;
will-change: transform;
backface-visibility: hidden;
will-change: transform;
}
```
<a href="https://evilmartians.com/?utm_source=postcss-will-change">
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
alt="Sponsored by Evil Martians" width="236" height="54">
</a>
## Usage
```js
postcss([ require('postcss-will-change') ])
**Step 1:** Install plugin:
```sh
npm install --save-dev postcss postcss-will-change
```
See [PostCSS] docs for examples for your environment.
**Step 2:** Check you project for existed PostCSS config: `postcss.config.js`
in the project root, `"postcss"` section in `package.json`
or `postcss` in bundle config.
If you do not use PostCSS, add it according to [official docs]
and set this plugin in settings.
**Step 3:** Add the plugin to plugins list:
```diff
module.exports = {
plugins: [
+ require('postcss-will-change'),
require('autoprefixer')
]
}
```
[official docs]: https://github.com/postcss/postcss#usage
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc