Socket
Socket
Sign inDemoInstall

postcss-page-break

Package Overview
Dependencies
4
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.2 to 3.0.3

10

CHANGELOG.md
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 3.0
## 3.0.3 - 2020-09-27
- Use `Declaration` event to work faster
- Fast check with `startsWith` before running slow regexp
- Avoid adding duplicate
Thanks to @ai
## 3.0.0 - 2020-09-20
* Updated: Support for PostCSS v8
## 2.0
## 2.0 - 2018-09-18
* Updated: Support for PostCSS v7

@@ -9,0 +15,0 @@

17

index.js
module.exports = function(options) {
return {
postcssPlugin: 'postcss-page-break',
Root(root) {
root.walkDecls(/^break-(inside|before|after)/, function(decl) {
Declaration(decl) {
if (decl.prop.startsWith('break-') && /^break-(inside|before|after)/.test(decl.prop)) {
// do not process column|region related properties

@@ -23,7 +23,10 @@ if (decl.value.search(/column|region/) >= 0) {

decl.cloneBefore({
prop: 'page-' + decl.prop,
value: newValue,
});
});
const newProperty = 'page-' + decl.prop;
if (decl.parent.every((sibling) => sibling.prop !== newProperty)) {
decl.cloneBefore({
prop: newProperty,
value: newValue,
});
}
}
},

@@ -30,0 +33,0 @@ };

{
"name": "postcss-page-break",
"version": "3.0.2",
"version": "3.0.3",
"description": "PostCSS plugin postcss-page-break to fallback `break-` properties with `page-break-` alias",

@@ -30,6 +30,6 @@ "files": [

"peerDependencies": {
"postcss": "^8.0.5"
"postcss": "^8"
},
"devDependencies": {
"eslint": "^7.9.0",
"eslint": "^7.10.0",
"eslint-config-google": "^0.14.0",

@@ -41,4 +41,4 @@ "eslint-plugin-jest": "^24.0.2",

"jest": "^26.4.2",
"postcss": "^8.0.5"
"postcss": "^8.1.0"
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc