Skip to content

Commit

Permalink
fix: expand composite objects and convert rem to px (#55)
Browse files Browse the repository at this point in the history
Co-authored-by: Davyd Melkon <131438868+davyd-akamai@users.noreply.github.com>
Co-authored-by: Jaalah Ramos <jaalah.ramos@gmail.com>
  • Loading branch information
3 people authored Jul 31, 2024
1 parent 7388c1b commit 210eebe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@linode/design-language-system",
"version": "2.6.0",
"version": "2.6.1",
"type": "module",
"module": "dist/index.js",
"exports": {
Expand Down
14 changes: 9 additions & 5 deletions style-dictionary/configs/getStyleDictionaryConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ export function getStyleDictionaryConfig(
// If we want to show collisions, we can change `include` to `source`.
include: theme.selectedTokenSets.map(tokenset => `tokens/${tokenset}.json`),
preprocessors: ["tokens-studio"],
expand: {
typesMap: expandTypesMap,
log: {
warnings: 'warn',
verbosity: 'verbose',
errors: {
brokenReferences: 'throw',
},
},
platforms: {
js: {
transformGroup: 'tokens-studio',
transforms: ['name/pascal', 'size/px', 'color/hex', 'shadow/css/shorthand', 'typography/css/shorthand'],
transforms: ['name/pascal', 'color/hex', 'shadow/css/shorthand', 'typography/css/shorthand'],
buildPath,
prefix: `${PREFIX}-`,
files: [
Expand All @@ -50,7 +54,7 @@ export function getStyleDictionaryConfig(
},
scss: {
transformGroup: 'tokens-studio',
transforms: ['name/kebab', 'time/seconds', 'size/px', 'color/css', 'shadow/css/shorthand', 'typography/css/shorthand'],
transforms: ['name/kebab', 'time/seconds', 'color/css', 'shadow/css/shorthand', 'typography/css/shorthand'],
buildPath,
prefix: `${PREFIX}-`,
files: [
Expand All @@ -62,7 +66,7 @@ export function getStyleDictionaryConfig(
},
css: {
transformGroup: 'tokens-studio',
transforms: ['name/kebab', 'time/seconds', 'size/px', 'color/css', 'shadow/css/shorthand', 'typography/css/shorthand'],
transforms: ['name/kebab', 'time/seconds', 'color/css', 'shadow/css/shorthand', 'typography/css/shorthand'],
buildPath,
prefix: `${PREFIX}-`,
files: [
Expand Down
21 changes: 14 additions & 7 deletions tokens/alias/light.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,20 @@
"fontFamily": "{global.font.font-family.brand}",
"fontWeight": "{global.font.font-weight.extrabold}",
"fontSize": "{global.font.font-size.xxxs}",
"lineHeight": "{global.font.line-height.xxxs}",
"textCase": "{global.font.textcase.uppercase}",
"letterSpacing": "3%"
"lineHeight": "{global.font.line-height.xxxs}"
},
"type": "typography",
"description": "Custom labels for content blocks"
},
"overline-letter-spacing": {
"value": "0.023rem",
"type": "typography",
"description": "Overline letter spacing"
},
"overline-text-case": {
"value": "{global.font.textcase.uppercase}",
"type": "typography",
"description": "Overline text case"
}
},
"body": {
Expand Down Expand Up @@ -507,8 +515,7 @@
"fontFamily": "{global.font.font-family.brand}",
"fontWeight": "{global.font.font-weight.regular.normal}",
"fontSize": "{global.font.font-size.xs}",
"lineHeight": "{global.font.line-height.xs}",
"paragraphSpacing": "8"
"lineHeight": "{global.font.line-height.xs}"
},
"type": "typography",
"description": "For list items"
Expand Down Expand Up @@ -543,7 +550,7 @@
"lineHeight": "{global.font.line-height.xxxs}"
},
"type": "typography",
"description": "Large buttons, list, segmented buttons, side navigation, small tabls"
"description": "Large buttons, list, segmented buttons, side navigation, small tables"
},
"xs": {
"value": {
Expand Down Expand Up @@ -582,7 +589,7 @@
"fontFamily": "{global.font.font-family.brand}",
"fontWeight": "{global.font.font-weight.bold}",
"fontSize": "{global.font.font-size.xxxs}",
"lineHeight": "14px"
"lineHeight": "0.875rem"
},
"type": "typography",
"description": "Badge number"
Expand Down

0 comments on commit 210eebe

Please sign in to comment.