-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update Style Dictionary transform (#110)
Changes done: - Colors with alpha has been updated and now shows correct values - Parser has been updated to handle extensions transform - `rgba` transform has been updated to replace transparent colors by `transparent` value - Transform for `flatten-rgba` has been updated to support spaces, percentage alpha - Filters for `font-family` and `letter-spacing` have been updated to handle new changes in types - Transform for `font-weight` has been added to handle text variations - Transform for `line-height` has been added to handle px values - Shadow tokens documentation added - Visual tests for color tokens added [category:Infrastructure] Release Note: Bug fixing of generating wrong value for colors with alpha and replacing transparent colors by `transparent` value. New transforms has been added to handle text values of `font-weight` and px values of `line-height`. Transforms for `font-family` and `letter-spacing` have been updated to support different token types, transform for `flatten-rgba` has been updated to handle spaces and percentage alpha.
- Loading branch information
1 parent
228e4ce
commit 12c501d
Showing
10 changed files
with
263 additions
and
12 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
packages/canvas-tokens-docs/stories/system/ColorShadow.stories.mdx
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,39 @@ | ||
import {Meta, Unstyled} from '@storybook/blocks'; | ||
|
||
import {ShadowColors} from './examples/Color/Shadow'; | ||
|
||
<Meta title="Docs/System Tokens/Color/Shadow" /> | ||
|
||
<Unstyled> | ||
|
||
# System Shadow Color Tokens | ||
|
||
System shadow color tokens provide values for box shadow. | ||
|
||
## Usage | ||
|
||
```ts | ||
// styles.ts | ||
import {system} from '@workday/canvas-tokens-web'; | ||
|
||
const styles = { | ||
boxShadow: `0 0 0 var(${system.color.shadow['1']})`, | ||
}; | ||
``` | ||
|
||
```css | ||
// styles.css | ||
.card-text { | ||
boxshadow: 0 0 0 var(--cnvs-sys-color-shadow-1); | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## Tokens | ||
|
||
<ShadowColors /> | ||
|
||
--- | ||
|
||
</Unstyled> |
20 changes: 20 additions & 0 deletions
20
packages/canvas-tokens-docs/stories/system/examples/Color/Shadow.tsx
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,20 @@ | ||
import * as React from 'react'; | ||
import {system} from '@workday/canvas-tokens-web'; | ||
|
||
import { | ||
buildPaletteGroup, | ||
ColorGrid, | ||
sortSystemColorPalette, | ||
} from '../../../../components/ColorGrid'; | ||
|
||
const statusPalettes = buildPaletteGroup( | ||
'system.color.shadow', | ||
{ | ||
default: system.color.shadow.default, | ||
'1': system.color.shadow['1'], | ||
'2': system.color.shadow['2'], | ||
}, | ||
sortSystemColorPalette | ||
); | ||
|
||
export const ShadowColors = () => <ColorGrid name="Text Status Colors" palette={statusPalettes} />; |
100 changes: 100 additions & 0 deletions
100
packages/canvas-tokens-docs/stories/system/visual-testing/Color.stories.tsx
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,100 @@ | ||
import { | ||
BackgroundColors, | ||
BackgroundAlternateColors, | ||
BackgroundMutedColors, | ||
BackgroundContrastColors, | ||
BackgroundStatusColors, | ||
} from '../examples/Color/Background'; | ||
import { | ||
BorderColors, | ||
BorderContrastColors, | ||
BorderInputColors, | ||
BorderStatusColors, | ||
} from '../examples/Color/Border'; | ||
import {ForegroundColors, ForegroundStatusColors} from '../examples/Color/Foreground'; | ||
import {IconColors, IconPrimaryColors, IconStatusColors} from '../examples/Color/Icon'; | ||
import {ShadowColors} from '../examples/Color/Shadow'; | ||
import {StaticColors} from '../examples/Color/Static'; | ||
import {TextColors, TextStatusColors} from '../examples/Color/Text'; | ||
|
||
export default { | ||
title: 'Visual Tests/System Tokens/Colors', | ||
parameters: { | ||
chromatic: {disableSnapshot: false}, | ||
}, | ||
}; | ||
|
||
// BACKGROUND COLORS TESTS | ||
export const Background = { | ||
render: BackgroundColors, | ||
}; | ||
|
||
export const BackgroundAlternate = { | ||
render: BackgroundAlternateColors, | ||
}; | ||
|
||
export const BackgroundMuted = { | ||
render: BackgroundMutedColors, | ||
}; | ||
|
||
export const BackgroundContrast = { | ||
render: BackgroundContrastColors, | ||
}; | ||
|
||
export const BackgroundStatus = { | ||
render: BackgroundStatusColors, | ||
}; | ||
|
||
// BORDER COLORS TESTS | ||
export const Border = { | ||
render: BorderColors, | ||
}; | ||
export const BorderContrast = { | ||
render: BorderContrastColors, | ||
}; | ||
export const BorderInput = { | ||
render: BorderInputColors, | ||
}; | ||
export const BorderStatus = { | ||
render: BorderStatusColors, | ||
}; | ||
|
||
// FOREGROUND COLORS TESTS | ||
|
||
export const Foreground = { | ||
render: ForegroundColors, | ||
}; | ||
export const ForegroundStatus = { | ||
render: ForegroundStatusColors, | ||
}; | ||
|
||
// ICON COLORS TESTS | ||
|
||
export const Icon = { | ||
render: IconColors, | ||
}; | ||
export const IconPrimary = { | ||
render: IconPrimaryColors, | ||
}; | ||
export const IconStatus = { | ||
render: IconStatusColors, | ||
}; | ||
|
||
// SHADOW COLORS TESTS | ||
export const Shadow = { | ||
render: ShadowColors, | ||
}; | ||
|
||
// STATIC COLORS TESTS | ||
export const Static = { | ||
render: StaticColors, | ||
}; | ||
|
||
// TEXT COLORS TESTS | ||
export const Text = { | ||
render: TextColors, | ||
}; | ||
|
||
export const TextStatus = { | ||
render: TextStatusColors, | ||
}; |
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
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
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
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