Socket
Socket
Sign inDemoInstall

postcss-modules-values

Package Overview
Dependencies
4
Maintainers
4
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 3.0.0

10

package.json
{
"name": "postcss-modules-values",
"version": "2.0.0",
"version": "3.0.0",
"description": "PostCSS plugin for CSS Modules to pass arbitrary values between your module files",

@@ -16,3 +16,3 @@ "main": "src/index.js",

"travis": "yarn lint && yarn cover",
"prepublish": "yarn test"
"prepublishOnly": "yarn test"
},

@@ -38,10 +38,10 @@ "repository": {

"coveralls": "^3.0.2",
"mocha": "^5.2.0",
"eslint": "^5.9.0",
"nyc": "^13.1.0"
"mocha": "^6.1.4",
"nyc": "^14.1.0"
},
"dependencies": {
"icss-replace-symbols": "^1.1.0",
"icss-utils": "^4.0.0",
"postcss": "^7.0.6"
}
}

@@ -31,3 +31,3 @@ # CSS Modules: Values

/* alias paths for other values or composition */
@value colors: "./colors.css";
@value colors: "./colors.css";
/* import multiple from a single file */

@@ -37,3 +37,9 @@ @value primary, secondary from colors;

@value small as bp-small, large as bp-large from "./breakpoints.css";
/* value as selector name */
@value selectorValue: secondary-color;
.selectorValue {
color: secondary;
}
.header {

@@ -79,2 +85,3 @@ composes: text-primary from colors;

---
Glen Maddern, 2015.
'use strict';
const postcss = require('postcss');
const ICSSReplaceSymbols = require('icss-replace-symbols');
const replaceSymbols = require('icss-replace-symbols');
const ICSSUtils = require('icss-utils');

@@ -29,3 +28,3 @@ const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;

// Add to the definitions, knowing that values can refer to each other
definitions[key] = replaceSymbols.replaceAll(definitions, value);
definitions[key] = ICSSUtils.replaceValueSymbols(value, definitions);
atRule.remove();

@@ -91,3 +90,3 @@ }

/* Perform replacements */
ICSSReplaceSymbols.default(css, definitions);
ICSSUtils.replaceSymbols(css, definitions);

@@ -94,0 +93,0 @@ /* Add export rules if any */

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc