Skip to content

Commit

Permalink
🐛 Removed default tokens added to tailwind, added opacity-token
Browse files Browse the repository at this point in the history
  • Loading branch information
KenAJoh committed Dec 19, 2024
1 parent 858849d commit 7d1bf7c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions @navikt/core/tailwind/darkside.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import { kebabCaseForAlpha } from "../tokens/config/kebabCase";
import { breakpointsTokenConfig } from "../tokens/darkside/tokens/breakpoints";

const transformedTokens = Object.fromEntries(
Object.entries(TokensBuild).map(([key, value]) => {
return [kebabCaseForAlpha(key), value];
}),
Object.entries(TokensBuild)
.map(([key, value]) => {
return [kebabCaseForAlpha(key), value];
})
/* "* as" imports incldes key "default" where value is every token */
.filter(([key]) => key !== "default"),
);

const nonColorTokens = [
Expand All @@ -18,6 +21,7 @@ const nonColorTokens = [
"font-family",
"border-radius",
"breakpoint",
"opacity",
];
/*
* Assumes that all remaining names not in nonColorTokens are colors
Expand Down Expand Up @@ -50,6 +54,7 @@ export const config = {
lineHeight: extractTokensForCategory("font-line-height"),
fontFamily: extractTokensForCategory("font-family"),
borderRadius: extractTokensForCategory("border-radius"),
opacity: extractTokensForCategory("opacity"),
},
},
};
Expand Down

0 comments on commit 7d1bf7c

Please sign in to comment.