postcss-normalize-positions
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -47,3 +47,3 @@ 'use strict'; | ||
arg.forEach((part, index) => { | ||
const isPosition = ~directions.indexOf(part.value) || (0, _postcssValueParser.unit)(part.value); | ||
const isPosition = ~directions.indexOf(part.value.toLowerCase()) || (0, _postcssValueParser.unit)(part.value); | ||
const len = relevant.length - 1; | ||
@@ -74,31 +74,30 @@ if (relevant[len].start === null && isPosition) { | ||
} | ||
if (position.length === 1 || position[2].value === 'center') { | ||
if (position[2]) { | ||
const firstValue = position[0].value.toLowerCase(); | ||
const secondValue = position[2] && position[2].value ? position[2].value.toLowerCase() : null; | ||
if (position.length === 1 || secondValue === 'center') { | ||
if (secondValue) { | ||
position[2].value = position[1].value = ''; | ||
} | ||
const { value } = position[0]; | ||
const map = Object.assign({}, horizontal, { | ||
center | ||
}); | ||
if ((0, _has2.default)(map, value)) { | ||
position[0].value = map[value]; | ||
if ((0, _has2.default)(map, firstValue)) { | ||
position[0].value = map[firstValue]; | ||
} | ||
return; | ||
} | ||
if (position[0].value === 'center' && ~directions.indexOf(position[2].value)) { | ||
if (firstValue === 'center' && ~directions.indexOf(secondValue)) { | ||
position[0].value = position[1].value = ''; | ||
const { value } = position[2]; | ||
if ((0, _has2.default)(horizontal, value)) { | ||
position[2].value = horizontal[value]; | ||
if ((0, _has2.default)(horizontal, secondValue)) { | ||
position[2].value = horizontal[secondValue]; | ||
} | ||
return; | ||
} | ||
if ((0, _has2.default)(horizontal, position[0].value) && (0, _has2.default)(vertical, position[2].value)) { | ||
position[0].value = horizontal[position[0].value]; | ||
position[2].value = vertical[position[2].value]; | ||
if ((0, _has2.default)(horizontal, firstValue) && (0, _has2.default)(vertical, secondValue)) { | ||
position[0].value = horizontal[firstValue]; | ||
position[2].value = vertical[secondValue]; | ||
return; | ||
} else if ((0, _has2.default)(vertical, position[0].value) && (0, _has2.default)(horizontal, position[2].value)) { | ||
let first = position[0].value; | ||
position[0].value = horizontal[position[2].value]; | ||
position[2].value = vertical[first]; | ||
} else if ((0, _has2.default)(vertical, firstValue) && (0, _has2.default)(horizontal, secondValue)) { | ||
position[0].value = horizontal[secondValue]; | ||
position[2].value = vertical[firstValue]; | ||
return; | ||
@@ -105,0 +104,0 @@ } |
{ | ||
"name": "postcss-normalize-positions", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Normalize keyword values for position into length values.", | ||
@@ -33,3 +33,3 @@ "main": "dist/index.js", | ||
"has": "^1.0.0", | ||
"postcss": "^6.0.0", | ||
"postcss": "^7.0.0", | ||
"postcss-value-parser": "^3.0.0" | ||
@@ -36,0 +36,0 @@ }, |
@@ -19,3 +19,3 @@ # [postcss][postcss]-normalize-positions | ||
div { | ||
background-position: bottom right | ||
background-position: bottom left; | ||
} | ||
@@ -28,3 +28,3 @@ ``` | ||
div { | ||
background-position: 100% 100% | ||
background-position:0 100%; | ||
} | ||
@@ -31,0 +31,0 @@ ``` |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a 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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6521
94
+ Addedpicocolors@0.2.1(transitive)
+ Addedpostcss@7.0.39(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedpostcss@6.0.23(transitive)
- Removedsupports-color@5.5.0(transitive)
Updatedpostcss@^7.0.0