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)) {