@primer/stylelint-config 13.0.0-rc.77d8c5f → 13.0.0-rc.7a254e8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +469 -175
- package/dist/index.mjs +469 -175
- package/package.json +10 -15
- package/plugins/borders.js +196 -63
- package/plugins/lib/utils.js +49 -0
- package/plugins/spacing.js +20 -23
- package/plugins/typography.js +185 -23
- package/plugins/lib/primitives.js +0 -36
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {createRequire} from 'node:module'
|
|
2
|
-
|
|
3
|
-
const require = createRequire(import.meta.url)
|
|
4
|
-
|
|
5
|
-
export async function primitivesVariables(type) {
|
|
6
|
-
const variables = []
|
|
7
|
-
|
|
8
|
-
const files = []
|
|
9
|
-
switch (type) {
|
|
10
|
-
case 'size':
|
|
11
|
-
files.push('base/size/size.json')
|
|
12
|
-
break
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
for (const file of files) {
|
|
16
|
-
// eslint-disable-next-line import/no-dynamic-require
|
|
17
|
-
const data = require(`@primer/primitives/dist/styleLint/${file}`)
|
|
18
|
-
|
|
19
|
-
for (const key of Object.keys(data)) {
|
|
20
|
-
const size = data[key]
|
|
21
|
-
const values = size['value']
|
|
22
|
-
const intValue = parseInt(size['original']['value'])
|
|
23
|
-
if (![2, 6].includes(intValue)) {
|
|
24
|
-
values.push(`${intValue + 1}px`)
|
|
25
|
-
values.push(`${intValue - 1}px`)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
variables.push({
|
|
29
|
-
name: `--${size['name']}`,
|
|
30
|
-
values,
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return variables
|
|
36
|
-
}
|