From ee14db8a31ae0c2a4da5e0476b5c10735648f867 Mon Sep 17 00:00:00 2001 From: Alexandre Asselin Date: Tue, 21 Nov 2023 09:54:15 -0500 Subject: [PATCH] chore: Removed warning in tokens' package build (#97) --- packages/tokens/src/style-dictionary/config.ts | 3 +-- packages/tokens/src/style-dictionary/format/css-dark-mode.ts | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/tokens/src/style-dictionary/config.ts b/packages/tokens/src/style-dictionary/config.ts index eea1cf9e9..bb58b8f8b 100644 --- a/packages/tokens/src/style-dictionary/config.ts +++ b/packages/tokens/src/style-dictionary/config.ts @@ -10,7 +10,7 @@ export const fontsConfig: Config = { "source": ["src/tokens/asset/*.tokens.json"], "platforms": { "css-font-face": { - "transforms": ["attribute/font"], + "transforms": ["name/cti/kebab", "attribute/font"], "buildPath": `${BUILD_PATH}`, "files": [ { @@ -101,7 +101,6 @@ export function getStyleDictionaryConfig(mode: "light" | "dark"): Config { const darkConfig: File = { "destination": "dark/tokens.css", "format": "css/dark-mode", - "filter": "mode/dark", "options": { "outputReferences": true } diff --git a/packages/tokens/src/style-dictionary/format/css-dark-mode.ts b/packages/tokens/src/style-dictionary/format/css-dark-mode.ts index be39ee262..13b154ea8 100644 --- a/packages/tokens/src/style-dictionary/format/css-dark-mode.ts +++ b/packages/tokens/src/style-dictionary/format/css-dark-mode.ts @@ -1,9 +1,8 @@ import type { Dictionary } from "style-dictionary"; +import { isDarkTokens } from "../filter/isDarkTokens.ts"; export const cssDarkMode = function ({ dictionary }: { dictionary: Dictionary }) { - const darkTokens = dictionary.allTokens.filter(token => { - return token.filePath.includes("dark"); - }).map(token => { + const darkTokens = dictionary.allTokens.filter(isDarkTokens).map(token => { let value = token.value; if (dictionary.usesReference(token.original.value)) {