diff --git a/packages/react/rollup.config.mjs b/packages/react/rollup.config.mjs index 22ee1e85bea..ed6dbc4e900 100644 --- a/packages/react/rollup.config.mjs +++ b/packages/react/rollup.config.mjs @@ -134,19 +134,35 @@ const baseConfig = { importFrom: [ () => { let customProperties = {} - const filePaths = glob.sync(['**/*.json'], { - cwd: path.join(__dirname, '../../node_modules/@primer/primitives/dist/fallbacks/'), - ignore: ['color-fallbacks.json'], + const filePaths = glob.sync(['fallbacks/**/*.json', 'docs/functional/themes/light.json'], { + cwd: path.join(__dirname, '../../node_modules/@primer/primitives/dist/'), + ignore: ['fallbacks/color-fallbacks.json'], }) for (const filePath of filePaths) { const fileData = fs.readFileSync( - path.join(__dirname, '../../node_modules/@primer/primitives/dist/fallbacks/', filePath), + path.join(__dirname, '../../node_modules/@primer/primitives/dist/', filePath), 'utf8', ) + + if (fileData.includes('--color-border-default')) { + console.log(filePath) + } + + const jsonData = JSON.parse(fileData) + let result = {} + + if (filePath === 'docs/functional/themes/light.json') { + for (const variable of Object.keys(jsonData)) { + result[`--${variable}`] = jsonData[variable].value + } + } else { + result = jsonData + } + customProperties = { ...customProperties, - ...JSON.parse(fileData), + ...result, } } diff --git a/packages/react/src/Button/ButtonBase.module.css b/packages/react/src/Button/ButtonBase.module.css index 0d9f8959c2e..181b2cd9c53 100644 --- a/packages/react/src/Button/ButtonBase.module.css +++ b/packages/react/src/Button/ButtonBase.module.css @@ -2,7 +2,7 @@ .ButtonBase { border-radius: var(--borderRadius-medium); border: var(--borderWidth-thin) solid; - border-color: var(--button-default-borderColor-rest, var(--borderColor-default)); + border-color: var(--button-default-borderColor-rest); font-family: inherit; font-weight: var(--base-text-weight-medium); font-size: var(--text-body-size-medium);