postcss-place
Advanced tools
Comparing version 3.0.0 to 3.0.1
# Changes to PostCSS Place Properties | ||
### 3.0.0 (May 8, 2018) | ||
### 3.0.1 (May 8, 2018) | ||
- Updated: `postcss-selector-parser` to v4.0.0 (major) | ||
- Updated: `postcss-values-parser` to v1.5.0 (major) | ||
- Updated: `postcss` to v6.0.22 (patch) | ||
@@ -7,0 +7,0 @@ |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var postcss = _interopDefault(require('postcss')); | ||
var parser = _interopDefault(require('postcss-value-parser')); | ||
var parser = _interopDefault(require('postcss-values-parser')); | ||
@@ -21,13 +21,9 @@ var placeMatch = /^place-(content|items|self)/; | ||
// value | ||
var value = parser(decl.value); | ||
// value ast and child nodes | ||
var value = parser(decl.value).parse(); | ||
var children = value.nodes[0].nodes; | ||
// divider position | ||
var index = value.nodes.map(function (node) { | ||
return node.type; | ||
}).indexOf('space'); | ||
// new justify-[alignment] and align-[alignment] declarations | ||
var alignValue = index === -1 ? decl.value : parser.stringify(value.nodes.slice(0, index)); | ||
var justifyValue = index === -1 ? decl.value : parser.stringify(value.nodes.slice(index + 1)); | ||
var alignValue = children.length === 1 ? decl.value : String(children.slice(0, 1)).trim(); | ||
var justifyValue = children.length === 1 ? decl.value : String(children.slice(1)).trim(); | ||
@@ -34,0 +30,0 @@ decl.cloneBefore({ |
import postcss from 'postcss'; | ||
import parser from 'postcss-value-parser'; | ||
import parser from 'postcss-values-parser'; | ||
@@ -16,13 +16,9 @@ var placeMatch = /^place-(content|items|self)/; | ||
// value | ||
var value = parser(decl.value); | ||
// value ast and child nodes | ||
var value = parser(decl.value).parse(); | ||
var children = value.nodes[0].nodes; | ||
// divider position | ||
var index = value.nodes.map(function (node) { | ||
return node.type; | ||
}).indexOf('space'); | ||
// new justify-[alignment] and align-[alignment] declarations | ||
var alignValue = index === -1 ? decl.value : parser.stringify(value.nodes.slice(0, index)); | ||
var justifyValue = index === -1 ? decl.value : parser.stringify(value.nodes.slice(index + 1)); | ||
var alignValue = children.length === 1 ? decl.value : String(children.slice(0, 1)).trim(); | ||
var justifyValue = children.length === 1 ? decl.value : String(children.slice(1)).trim(); | ||
@@ -29,0 +25,0 @@ decl.cloneBefore({ |
{ | ||
"name": "postcss-place", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Use a place-* shorthand for align-* and justify-* in CSS", | ||
@@ -29,3 +29,3 @@ "author": "Jonathan Neal <jonathantneal@hotmail.com>", | ||
"postcss": "^6.0.22", | ||
"postcss-value-parser": "^3.3.0" | ||
"postcss-values-parser": "^1.5.0" | ||
}, | ||
@@ -32,0 +32,0 @@ "devDependencies": { |
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
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
15419
68
+ Addedpostcss-values-parser@^1.5.0
+ Addedflatten@1.0.3(transitive)
+ Addedindexes-of@1.0.1(transitive)
+ Addedpostcss-values-parser@1.5.0(transitive)
+ Addeduniq@1.0.1(transitive)
- Removedpostcss-value-parser@^3.3.0
- Removedpostcss-value-parser@3.3.1(transitive)