@atlaskit/tokens
Advanced tools
Comparing version 1.21.0 to 1.21.1
@@ -31,3 +31,17 @@ "use strict"; | ||
value = rawToken.value.reduce(function (prev, curr, index) { | ||
var value = "".concat(curr.offset.x, "px ").concat(curr.offset.y, "px ").concat(curr.radius, "px ").concat(curr.color); | ||
var color = curr.color; | ||
// Opacity needs to be added to hex values that don't already contain it. | ||
// If it contained opacity, the length would be 9 instead of 7. | ||
if (color.length === 7 && curr.opacity) { | ||
var opacityAsHex = curr.opacity.toString(16); // 0.4f5c28f5c28f5c | ||
var shortenedHex = opacityAsHex.slice(2, 4); // 4f | ||
// The hex value has to have a length of 2. If it's shorter, a "0" needs to be added. | ||
if (shortenedHex.length === 1) { | ||
shortenedHex += '0'; | ||
} | ||
color += shortenedHex; | ||
} | ||
var value = "".concat(curr.offset.x, "px ").concat(curr.offset.y, "px ").concat(curr.radius, "px ").concat(color); | ||
if (index === 0) { | ||
@@ -34,0 +48,0 @@ value += ", "; |
@@ -11,3 +11,3 @@ "use strict"; | ||
var name = "@atlaskit/tokens"; | ||
var version = "1.21.0"; | ||
var version = "1.21.1"; | ||
/** | ||
@@ -14,0 +14,0 @@ * Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the |
@@ -12,3 +12,3 @@ "use strict"; | ||
var name = "@atlaskit/tokens"; | ||
var version = "1.21.0"; | ||
var version = "1.21.1"; | ||
/** | ||
@@ -15,0 +15,0 @@ * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token. |
@@ -18,3 +18,17 @@ import * as t from '@babel/types'; | ||
value = rawToken.value.reduce((prev, curr, index) => { | ||
let value = `${curr.offset.x}px ${curr.offset.y}px ${curr.radius}px ${curr.color}`; | ||
let color = curr.color; | ||
// Opacity needs to be added to hex values that don't already contain it. | ||
// If it contained opacity, the length would be 9 instead of 7. | ||
if (color.length === 7 && curr.opacity) { | ||
const opacityAsHex = curr.opacity.toString(16); // 0.4f5c28f5c28f5c | ||
let shortenedHex = opacityAsHex.slice(2, 4); // 4f | ||
// The hex value has to have a length of 2. If it's shorter, a "0" needs to be added. | ||
if (shortenedHex.length === 1) { | ||
shortenedHex += '0'; | ||
} | ||
color += shortenedHex; | ||
} | ||
let value = `${curr.offset.x}px ${curr.offset.y}px ${curr.radius}px ${color}`; | ||
if (index === 0) { | ||
@@ -21,0 +35,0 @@ value += `, `; |
import warnOnce from '@atlaskit/ds-lib/warn-once'; | ||
import tokens from './artifacts/token-names'; | ||
const name = "@atlaskit/tokens"; | ||
const version = "1.21.0"; | ||
const version = "1.21.1"; | ||
/** | ||
@@ -6,0 +6,0 @@ * Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the |
@@ -5,3 +5,3 @@ import warnOnce from '@atlaskit/ds-lib/warn-once'; | ||
const name = "@atlaskit/tokens"; | ||
const version = "1.21.0"; | ||
const version = "1.21.1"; | ||
/** | ||
@@ -8,0 +8,0 @@ * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token. |
@@ -21,3 +21,17 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
value = rawToken.value.reduce(function (prev, curr, index) { | ||
var value = "".concat(curr.offset.x, "px ").concat(curr.offset.y, "px ").concat(curr.radius, "px ").concat(curr.color); | ||
var color = curr.color; | ||
// Opacity needs to be added to hex values that don't already contain it. | ||
// If it contained opacity, the length would be 9 instead of 7. | ||
if (color.length === 7 && curr.opacity) { | ||
var opacityAsHex = curr.opacity.toString(16); // 0.4f5c28f5c28f5c | ||
var shortenedHex = opacityAsHex.slice(2, 4); // 4f | ||
// The hex value has to have a length of 2. If it's shorter, a "0" needs to be added. | ||
if (shortenedHex.length === 1) { | ||
shortenedHex += '0'; | ||
} | ||
color += shortenedHex; | ||
} | ||
var value = "".concat(curr.offset.x, "px ").concat(curr.offset.y, "px ").concat(curr.radius, "px ").concat(color); | ||
if (index === 0) { | ||
@@ -24,0 +38,0 @@ value += ", "; |
import warnOnce from '@atlaskit/ds-lib/warn-once'; | ||
import tokens from './artifacts/token-names'; | ||
var name = "@atlaskit/tokens"; | ||
var version = "1.21.0"; | ||
var version = "1.21.1"; | ||
/** | ||
@@ -6,0 +6,0 @@ * Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the |
@@ -5,3 +5,3 @@ import warnOnce from '@atlaskit/ds-lib/warn-once'; | ||
var name = "@atlaskit/tokens"; | ||
var version = "1.21.0"; | ||
var version = "1.21.1"; | ||
/** | ||
@@ -8,0 +8,0 @@ * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token. |
{ | ||
"name": "@atlaskit/tokens", | ||
"version": "1.21.0", | ||
"version": "1.21.1", | ||
"description": "Design tokens are the single source of truth to name and store design decisions.", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
Sorry, the diff of this file is too big to display
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
9355680
220925