New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@justeat/pie-design-tokens

Package Overview
Dependencies
Maintainers
0
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@justeat/pie-design-tokens - npm Package Compare versions

Comparing version 6.6.0 to 6.7.0

13

build/compileToScss.js
const {
CONSTANTS,
convertGlobalTokenValueToStylesValue,
convertHexValueToRGB,
convertWordToPascalCase,

@@ -21,5 +22,7 @@ getConvertedShadowsToBoxShadowValues,

let currentThemeTokens = {};
/**
* Returns a token value using the specified category and name properties passed in.
* Also handles some special cases (such as rgba format for colour aliases).
* Also handles some special cases (such as rgb format with opacity for colour aliases).
*

@@ -35,3 +38,3 @@ * @param {string} category – Object key referencing the category of global token to access (i.e. color, font, radius)

// If the category is a color and it includes a pipe character, then it'll be in the format `ALIAS_NAME|OPACITY` or `ALIAS_NAME,PERCENTAGE%`
// So we need to replace the ALIAS_NAME with the global value and then convert that hex value to an RGBA
// So we need to replace the ALIAS_NAME with the global token value and then convert that hex value to RGB
// if not, then we can just convert the alias using the global values we have

@@ -41,4 +44,6 @@ if (baseCategory === 'color' && name.includes('|')) {

varName = `${baseCategory}-${nameParts[0]}`;
const globalColorTokens = currentThemeTokens.color[GLOBAL_TOKEN_KEY];
const hexValue = globalColorTokens[nameParts[0]];
return `rgba(${getScssVarValue(varName)}, ${nameParts[1]})`;
return convertHexValueToRGB(hexValue, nameParts[1]);
} else if (baseCategory === 'color' && name.includes('%')) {

@@ -160,2 +165,4 @@ // We just care about the % for HSL calculations

currentThemeTokens = themeTokens;
// e.g. color/font/spacing

@@ -162,0 +169,0 @@ categoryKeys.forEach((category) => {

@@ -175,3 +175,3 @@ const fs = require('fs');

/**
* Converts a given hex value to rgb value with optional opacity parametr.
* Converts a given hex value to rgb value with optional opacity parameter.
* @param {string} hexCode – hex colour code

@@ -178,0 +178,0 @@ * @param {string} opacity – optional opacity value

@@ -2095,3 +2095,3 @@ {

},
"version": "6.6.0"
"version": "6.7.0"
}
{
"name": "@justeat/pie-design-tokens",
"version": "6.6.0",
"version": "6.7.0",
"description": "Design Tokens for the PIE Component System",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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