Skip to content

Commit 325c378

Browse files
committed
2.0.1
1 parent 5a6e848 commit 325c378

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Changes to PostCSS Lab Function
22

3+
### 2.0.1 (September 18, 2018)
4+
5+
- Updated: PostCSS Values Parser 2.0.0
6+
37
### 2.0.0 (September 17, 2018)
48

5-
- Updated: Support for PostCSS v7+
6-
- Updated: Support for Node v6+
9+
- Updated: Support for PostCSS 7+
10+
- Updated: Support for Node 6+
711

812
### 1.1.0 (July 24, 2018)
913

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Installing PostCSS
1+
# Installing PostCSS Lab Function
22

33
[PostCSS Lab Function] runs in all Node environments, with special
44
instructions for:

index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default postcss.plugin('postcss-lab-function', opts => {
4141
}
4242
}
4343

44-
if (isSlash(slashNode)) {
44+
if (slashNode && isSlash(slashNode)) {
4545
slashNode.replaceWith( newComma() );
4646
}
4747

@@ -129,12 +129,12 @@ const alphaUnitMatch = /^%?$/i;
129129
const calcFuncMatch = /^calc$/i;
130130
const hueUnitMatch = /^(deg|grad|rad|turn)?$/i;
131131

132-
const isAlphaValue = node => isCalc(node) || Object(node).type === 'number' && alphaUnitMatch.test(node.unit);
133-
const isCalc = node => Object(node).type === 'func' && calcFuncMatch.test(node.value);
134-
const isHue = node => isCalc(node) || Object(node).type === 'number' && hueUnitMatch.test(node.unit);
135-
const isNumber = node => isCalc(node) || Object(node).type === 'number' && node.unit === '';
136-
const isPercentage = node => isCalc(node) || Object(node).type === 'number' && node.unit === '%';
137-
const isSlash = node => Object(node).type === 'operator' && node.value === '/';
132+
const isAlphaValue = node => isCalc(node) || node.type === 'number' && alphaUnitMatch.test(node.unit);
133+
const isCalc = node => node.type === 'func' && calcFuncMatch.test(node.value);
134+
const isHue = node => isCalc(node) || node.type === 'number' && hueUnitMatch.test(node.unit);
135+
const isNumber = node => isCalc(node) || node.type === 'number' && node.unit === '';
136+
const isPercentage = node => isCalc(node) || node.type === 'number' && node.unit === '%';
137+
const isSlash = node => node.type === 'operator' && node.value === '/';
138138
const functionalLABMatch = [isNumber, isNumber, isNumber, isSlash, isAlphaValue];
139139
const functionalLCHMatch = [isNumber, isNumber, isHue, isSlash, isAlphaValue];
140140
const functionalGrayMatch = [isNumber, isSlash, isAlphaValue];

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-lab-function",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Use lab() and lch() color functions in CSS",
55
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
66
"license": "CC0-1.0",
@@ -29,18 +29,18 @@
2929
"dependencies": {
3030
"@csstools/convert-colors": "^1.4.0",
3131
"postcss": "^7.0.2",
32-
"postcss-values-parser": "^1.5.0"
32+
"postcss-values-parser": "^2.0.0"
3333
},
3434
"devDependencies": {
35-
"@babel/core": "^7.0.0",
36-
"@babel/preset-env": "^7.0.0",
35+
"@babel/core": "^7.1.0",
36+
"@babel/preset-env": "^7.1.0",
3737
"babel-eslint": "^9.0.0",
3838
"eslint": "^5.6.0",
3939
"eslint-config-dev": "^2.0.0",
4040
"postcss-tape": "^2.2.0",
4141
"pre-commit": "^1.2.2",
4242
"rollup": "^0.66.0",
43-
"rollup-plugin-babel": "^4.0.1"
43+
"rollup-plugin-babel": "^4.0.3"
4444
},
4545
"eslintConfig": {
4646
"extends": "dev",

0 commit comments

Comments
 (0)