Skip to content

Commit

Permalink
Add syntax for css classes to variables (#779)
Browse files Browse the repository at this point in the history
* Add syntax for css classes to variables

* Update jsonFigma.ts

* adding utility classes

* adding utility classes

* add classes to dark mode

* Update src/tokens/functional/size/size.json

Co-authored-by: Katie Langerman <[email protected]>

* Update src/tokens/functional/size/size.json

Co-authored-by: Katie Langerman <[email protected]>

* Update src/tokens/functional/size/size.json

Co-authored-by: Katie Langerman <[email protected]>

---------

Co-authored-by: Katie Langerman <[email protected]>
  • Loading branch information
lukasoppermann and langermank authored Nov 22, 2023
1 parent 8ba7d6b commit 105afb5
Show file tree
Hide file tree
Showing 8 changed files with 386 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-shrimps-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/primitives': patch
---

adding CodeSyntax to tokens for figma
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"editor.formatOnSave": true,
"prettier.configPath": ".prettierrc.js",
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down
3 changes: 2 additions & 1 deletion src/formats/jsonFigma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const jsonFigma: StyleDictionary.Formatter = ({dictionary, file: _file, p
// sort tokens by reference
const tokens = dictionary.allTokens.sort(sortByReference(dictionary)).map(token => {
const {attributes, value, $type, comment: description, original, alpha, mix} = token
const {mode, collection, scopes, group} = attributes || {}
const {mode, collection, scopes, group, codeSyntax} = attributes || {}

return {
name: token.name,
Expand All @@ -52,6 +52,7 @@ export const jsonFigma: StyleDictionary.Formatter = ({dictionary, file: _file, p
mode,
group,
scopes,
codeSyntax,
}
})
// add file header and convert output
Expand Down
Loading

0 comments on commit 105afb5

Please sign in to comment.