-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[web-components]: remove design token implementation in favor of plat…
…form solution (#30002)
- Loading branch information
1 parent
813e1b2
commit ff0de1b
Showing
33 changed files
with
1,599 additions
and
1,495 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-web-components-258db20e-84e5-451e-a289-97726ba08b24.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "feat: remove JS design token implementation in favor of platform css variables", | ||
"packageName": "@fluentui/web-components", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const chalk = require('chalk'); | ||
const pkg = require('@fluentui/tokens'); | ||
|
||
const { tokens } = pkg; | ||
|
||
const fluentTokens = Object.keys(tokens); | ||
const comment = '// THIS FILE IS GENERATED AS PART OF THE BUILD PROCESS. DO NOT MANUALLY MODIFY THIS FILE\n'; | ||
|
||
const generatedTokens = fluentTokens.reduce((acc, t) => { | ||
const token = `export const ${t} = '--${t}';\n`; | ||
return acc + token; | ||
}, ''); | ||
|
||
const dir = path.join(__dirname, '../src', 'theme'); | ||
|
||
if (!fs.existsSync(dir)) { | ||
fs.mkdirSync(dir, { recursive: true }); | ||
} | ||
|
||
fs.writeFile(path.join(dir, 'design-tokens.ts'), comment + generatedTokens, err => { | ||
if (err) throw err; | ||
console.log(chalk.greenBright(`Design token file has been successfully created!`)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.