postcss-color-functional-notation
Advanced tools
Comparing version 1.0.0 to 1.0.1
# Changes to PostCSS Color Functional Notation | ||
### 1.0.1 (May 11, 2018) | ||
- Fixed: A non-percentage 0 works alongside other percentages | ||
### 1.0.0 (May 7, 2018) | ||
- Initial version |
@@ -8,5 +8,2 @@ 'use strict'; | ||
var colorAnyRegExp = /(^|[^\w-])(hsla?|rgba?)\(/i; | ||
var colorRegExp = /^(hsla?|rgba?)$/i; | ||
var index = postcss.plugin('postcss-color-functional-notation', function (opts) { | ||
@@ -79,5 +76,7 @@ var preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : false; | ||
var calcFuncMatch = /^calc$/i; | ||
var hueUnitMatch = /^(deg|grad|rad|turn)?$/i; | ||
var colorAnyRegExp = /(^|[^\w-])(hsla?|rgba?)\(/i; | ||
var colorRegExp = /^(hsla?|rgba?)$/i; | ||
var hslRgbFuncMatch = /^(hsl|rgb)$/i; | ||
var hslaRgbaFuncMatch = /^(hsla|rgba)$/i; | ||
var hueUnitMatch = /^(deg|grad|rad|turn)?$/i; | ||
var isAlphaValue = function isAlphaValue(node) { | ||
@@ -96,3 +95,3 @@ return isCalc(node) || Object(node).type === 'number' && alphaUnitMatch.test(node.unit); | ||
var isPercentage = function isPercentage(node) { | ||
return isCalc(node) || Object(node).type === 'number' && node.unit === '%'; | ||
return isCalc(node) || Object(node).type === 'number' && (node.unit === '%' || node.unit === '' && node.value === '0'); | ||
}; | ||
@@ -99,0 +98,0 @@ var isHslRgb = function isHslRgb(node) { |
import postcss from 'postcss'; | ||
import parser from 'postcss-values-parser'; | ||
var colorAnyRegExp = /(^|[^\w-])(hsla?|rgba?)\(/i; | ||
var colorRegExp = /^(hsla?|rgba?)$/i; | ||
var index = postcss.plugin('postcss-color-functional-notation', function (opts) { | ||
@@ -74,5 +71,7 @@ var preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : false; | ||
var calcFuncMatch = /^calc$/i; | ||
var hueUnitMatch = /^(deg|grad|rad|turn)?$/i; | ||
var colorAnyRegExp = /(^|[^\w-])(hsla?|rgba?)\(/i; | ||
var colorRegExp = /^(hsla?|rgba?)$/i; | ||
var hslRgbFuncMatch = /^(hsl|rgb)$/i; | ||
var hslaRgbaFuncMatch = /^(hsla|rgba)$/i; | ||
var hueUnitMatch = /^(deg|grad|rad|turn)?$/i; | ||
var isAlphaValue = function isAlphaValue(node) { | ||
@@ -91,3 +90,3 @@ return isCalc(node) || Object(node).type === 'number' && alphaUnitMatch.test(node.unit); | ||
var isPercentage = function isPercentage(node) { | ||
return isCalc(node) || Object(node).type === 'number' && node.unit === '%'; | ||
return isCalc(node) || Object(node).type === 'number' && (node.unit === '%' || node.unit === '' && node.value === '0'); | ||
}; | ||
@@ -94,0 +93,0 @@ var isHslRgb = function isHslRgb(node) { |
{ | ||
"name": "postcss-color-functional-notation", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Use space and slash separated color notation in CSS", | ||
@@ -34,3 +34,3 @@ "author": "Jonathan Neal <jonathantneal@hotmail.com>", | ||
"babel-eslint": "^8.2.3", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-env": "^1.7.0", | ||
"eslint": "^4.19.1", | ||
@@ -37,0 +37,0 @@ "eslint-config-dev": "^2.0.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
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
22480