From fa0910a3870b852ffcea85f7f7c022764b89e724 Mon Sep 17 00:00:00 2001 From: andrey-canon Date: Thu, 23 Feb 2023 12:16:53 -0500 Subject: [PATCH] refactor: destructuring name token --- tokens/css-utilities.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tokens/css-utilities.js b/tokens/css-utilities.js index 55c7b0ad090..106771a85d9 100644 --- a/tokens/css-utilities.js +++ b/tokens/css-utilities.js @@ -2,10 +2,10 @@ * Implements bg-variant mixin from bootstrap. Creates utility classes for background colors based on theme color. */ function bgVariant(token) { - const { attributes: { type, item }, actions } = token; + const { attributes: { type, item }, name, actions } = token; const parent = `.bg-${type}${item === 'base' ? '' : `-${item}`}`; return `${parent} { - background-color: ${`var(--${token.name})`} !important; + background-color: ${`var(--${name})`} !important; } a${parent}:hover, @@ -22,10 +22,10 @@ button${parent}:focus { * Implements text-emphasis-variant mixin from bootstrap. Creates utility classes for text colors based on theme color. */ function textEmphasisVariant(token) { - const { attributes: { type, item }, actions } = token; + const { attributes: { type, item }, name, actions } = token; const parent = `.text-${type}${item === 'base' ? '' : `-${item}`}`; return `${parent} { - color: ${`var(--${token.name})`} !important; + color: ${`var(--${name})`} !important; } a${parent}:hover, @@ -40,10 +40,10 @@ a${parent}:focus { * Creates utility class for border color. */ function borderColor(token) { - const { attributes: { type, item } } = token; + const { attributes: { type, item }, name } = token; const className = `.border-${type}${item === 'base' ? '' : `-${item}`}`; return `${className} { - border-color: ${`var(--${token.name})`} !important; + border-color: ${`var(--${name})`} !important; } `;