-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add color recipes to web component packages (#16755)
* feat: move color recipes into fluent web component package * Change files * udpate recipe paths * ensure tests and syntax are correct * add more typedoc comments * update FAST deps * add generated file to prettier ignore * Change files
- Loading branch information
1 parent
84ab12f
commit e4079ad
Showing
57 changed files
with
4,871 additions
and
172 deletions.
There are no files selected for viewing
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
8 changes: 8 additions & 0 deletions
8
...entui-web-components-2021-02-02-11-55-41-users-chhol-add-color-recipes-to-wc-package.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,8 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "feat: move color recipes into fluent web component package", | ||
"packageName": "@fluentui/web-components", | ||
"email": "chhol@microsoft.com", | ||
"dependentChangeType": "patch", | ||
"date": "2021-02-02T19:55:41.615Z" | ||
} |
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
29 changes: 29 additions & 0 deletions
29
packages/web-components/build/generate-default-palettes.js
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,29 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import { parseColorHexRGB } from '@microsoft/fast-colors'; | ||
import { createColorPalette } from '../src/color/create-color-palette'; | ||
import { accentBaseColor, neutralBaseColor } from '../src/color/color-constants'; | ||
|
||
const outpath = path.resolve(__dirname, '../src/default-palette.ts'); | ||
|
||
/** | ||
* Define palettes from base colors | ||
*/ | ||
const neutralPalette = createColorPalette(parseColorHexRGB(neutralBaseColor)); | ||
const accentPalette = createColorPalette(parseColorHexRGB(accentBaseColor)); | ||
|
||
const file = `/** | ||
* DO NOT EDIT THIS FILE DIRECTLY | ||
* This file generated by web-components/build/${path.parse(__filename).name}${path.parse(__filename).ext} | ||
*/ | ||
export const neutralPalette: string[] = ${JSON.stringify(neutralPalette, null, 4)}; | ||
export const accentPalette: string[] = ${JSON.stringify(accentPalette, null, 4)}; | ||
`; | ||
|
||
fs.writeFile(outpath, file, error => { | ||
if (error) { | ||
throw error; | ||
} else { | ||
console.log('\nPalette data written to', outpath, '\n'); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.