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

postcss-lab-function

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-lab-function - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

4

CHANGELOG.md
# Changes to PostCSS Lab Function
### 3.1.0 (April 25, 2020)
- Updated: `postcss-values-parser` to 3.2.0 (minor).
### 3.0.1 (April 12, 2020)

@@ -4,0 +8,0 @@

29

dist/index.cjs.js

@@ -11,3 +11,3 @@ 'use strict';

const visitor = node => {
const onCSSFunction = node => {
/** @type {{ name: string, nodes: CSSNode[] }} */

@@ -155,14 +155,17 @@ const {

const visitor$1 = decl => {
const onCSSDeclaration = decl => {
const {
value
value: originalValue
} = decl;
if (hasAnyColorFunction(value)) {
const valueAST = postcssValuesParser.parse(value);
valueAST.walkFuncs(visitor);
const newValue = String(valueAST);
if (options.preserve) decl.cloneBefore({
value: newValue
});else decl.value = newValue;
if (hasAnyColorFunction(originalValue)) {
const valueAST = postcssValuesParser.parse(originalValue);
valueAST.walkFuncs(onCSSFunction);
const modifiedValue = String(valueAST);
if (modifiedValue !== originalValue) {
if (options.preserve) decl.cloneBefore({
value: modifiedValue
});else decl.value = modifiedValue;
}
}

@@ -180,3 +183,3 @@ };

const plugin = postcss.plugin('postcss-lab-function',
const postcssPlugin = postcss.plugin('postcss-lab-function',
/** @type {PostCSSPluginInitializer} */

@@ -186,3 +189,3 @@ opts => {

return root => {
root.walkDecls(visitor$1);
root.walkDecls(onCSSDeclaration);
};

@@ -196,2 +199,2 @@ });

module.exports = plugin;
module.exports = postcssPlugin;

@@ -7,3 +7,3 @@ import postcss from 'postcss';

const visitor = node => {
const onCSSFunction = node => {
/** @type {{ name: string, nodes: CSSNode[] }} */

@@ -151,14 +151,17 @@ const {

const visitor$1 = decl => {
const onCSSDeclaration = decl => {
const {
value
value: originalValue
} = decl;
if (hasAnyColorFunction(value)) {
const valueAST = parse(value);
valueAST.walkFuncs(visitor);
const newValue = String(valueAST);
if (options.preserve) decl.cloneBefore({
value: newValue
});else decl.value = newValue;
if (hasAnyColorFunction(originalValue)) {
const valueAST = parse(originalValue);
valueAST.walkFuncs(onCSSFunction);
const modifiedValue = String(valueAST);
if (modifiedValue !== originalValue) {
if (options.preserve) decl.cloneBefore({
value: modifiedValue
});else decl.value = modifiedValue;
}
}

@@ -176,3 +179,3 @@ };

const plugin = postcss.plugin('postcss-lab-function',
const postcssPlugin = postcss.plugin('postcss-lab-function',
/** @type {PostCSSPluginInitializer} */

@@ -182,3 +185,3 @@ opts => {

return root => {
root.walkDecls(visitor$1);
root.walkDecls(onCSSDeclaration);
};

@@ -192,2 +195,2 @@ });

export default plugin;
export default postcssPlugin;
{
"name": "postcss-lab-function",
"version": "3.0.1",
"version": "3.1.0",
"description": "Use lab() and lch() color functions in CSS",

@@ -30,3 +30,3 @@ "author": "Jonathan Neal <jonathantneal@hotmail.com>",

"postcss": "^7.0.27",
"postcss-values-parser": "^3.1.1"
"postcss-values-parser": "^3.2.0"
},

@@ -39,3 +39,3 @@ "devDependencies": {

"postcss-tape": "^5.0.2",
"rollup": "^2.6.0",
"rollup": "^2.7.2",
"rollup-plugin-babel": "^4.4.0"

@@ -42,0 +42,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