Skip to content

Commit

Permalink
Making fixes for primitives v10 rc (#539)
Browse files Browse the repository at this point in the history
* Making fix for primitives v10

* Create polite-carrots-pay.md
  • Loading branch information
jonrohan authored Nov 26, 2024
1 parent 30e7113 commit 2067c41
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .changeset/polite-carrots-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/stylelint-config": patch
---

Making fixes for primitives v10 rc
41 changes: 8 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "2.27.9",
"@github/prettier-config": "^0.0.6",
"@primer/primitives": "^10.0.0-rc.e5d395ea",
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
Expand Down
7 changes: 4 additions & 3 deletions plugins/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ export function primitivesVariables(type) {
const data = require(`@primer/primitives/dist/styleLint/${file}`)

for (const key of Object.keys(data)) {
const size = data[key]
const values = typeof size['value'] === 'string' ? [size['value']] : size['value']
const token = data[key]
const valueProp = '$value' in token ? '$value' : 'value'
const values = typeof token[valueProp] === 'string' ? [token[valueProp]] : token[valueProp]

variables.push({
name: `--${size['name']}`,
name: `--${token['name']}`,
values,
})
}
Expand Down

0 comments on commit 2067c41

Please sign in to comment.