Skip to content

Commit

Permalink
🐛 Use correct global token for darkside JS
Browse files Browse the repository at this point in the history
  • Loading branch information
KenAJoh committed Jan 29, 2025
1 parent 6c81fc0 commit 83960d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
16 changes: 9 additions & 7 deletions @navikt/core/react/src/tag/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
| "alt2-moderate"
| "alt3"
| "alt3-filled"
| "alt3-moderate"
| "meta-1"
| "meta-1-filled"
| "meta-1-moderate"
| "meta-2"
| "meta-2-filled"
| "meta-2-moderate";
| "alt3-moderate";

/* Temp hide these until naming is resolved */
// | "meta-1"
// | "meta-1-filled"
// | "meta-1-moderate"
// | "meta-2"
// | "meta-2-filled"
// | "meta-2-moderate";
/**
* @default "medium"
*/
Expand Down
5 changes: 5 additions & 0 deletions @navikt/core/tokens/darkside/style-dictionary.formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ function createTokenValue(token: TransformedToken): string {
if ((token.type as TokenTypes) === "global-breakpoints") {
return token.value ?? token.$value;
}

if ((token.type as TokenTypes) === "global-color") {
return `var(--${token.path.join("-")})`;
}

return `var(--${kebabName})`;
}

Expand Down

0 comments on commit 83960d7

Please sign in to comment.