Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-color-functional-notation

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-color-functional-notation - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

CHANGELOG.md
# 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

9

index.cjs.js

@@ -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",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc