Skip to content

Commit

Permalink
Add missing uswds colors. Fix type declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
narin committed Feb 5, 2024
1 parent 9e956bd commit 6de99f9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/tokens/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ StyleDictionary.registerFormat({
StyleDictionary.registerFormat({
name: 'typescript/es6-declarations/colors',
formatter: function (dictionary) {
let declaration = 'export declare const Colors: { [key: string]: string;\n'

This comment has been minimized.

Copy link
@narin

narin Feb 5, 2024

Author Contributor

Removing this now properly throws TS errors if a key isn't a valid color.

let declaration = 'export declare const Colors: {\n'
dictionary.allProperties.forEach((token) => {
declaration += ` ${token.name}: string;\n`
})
Expand Down
8 changes: 8 additions & 0 deletions packages/tokens/figma/color.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@
"$value": "#112f4e",
"$type": "color"
},
"uswdsGray30": {
"$value": "#adadad",
"$type": "color"
},
"uswdsGray80": {
"$value": "#2e2e2e",
"$type": "color"
},
"uswdsGrayWarm90": {
"$value": "#171716",
"$type": "color"
Expand Down
14 changes: 14 additions & 0 deletions packages/tokens/src/tokens/color/uswds.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@
"category": "uswds-system-color-blue-vivid-80"
}
},
"uswds-system-color-gray-30": {
"value": "#adadad",
"name": "uswds-system-color-gray-30",
"attributes": {
"category": "uswds-system-color-gray-30"
}
},
"uswds-system-color-gray-80": {
"value": "#2e2e2e",
"name": "uswds-system-color-gray-80",
"attributes": {
"category": "uswds-system-color-gray-80"
}
},
"uswds-system-color-gray-warm-90": {
"value": "#171716",
"name": "uswds-system-color-gray-warm-90",
Expand Down

0 comments on commit 6de99f9

Please sign in to comment.