-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: width and height tokens (#231)
* feat: width and height tokens * move to top level * don't show pixel value for percentages * update docs
- Loading branch information
1 parent
b6dace6
commit 7a430d6
Showing
3 changed files
with
80 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Meta } from '@storybook/addon-docs/blocks'; | ||
import sizes from '@palmetto/palmetto-design-tokens/build/js/variables-size'; | ||
import { PALMETTO_HEIGHT_OPTIONS, PALMETTO_HEIGHT_VALUES } from '../lib/tokens'; | ||
|
||
<Meta | ||
title="Design Tokens/Height" | ||
/> | ||
|
||
# Height | ||
|
||
Standard heights have been defined based on percentages or `rem`. | ||
|
||
Rem based values will scale when adjusting the root font size. Pixel values are calculated with a root font size of `16px`. | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>token name</th> | ||
<th>prop value</th> | ||
<th>value</th> | ||
<th>px</th> | ||
<th>notes</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{PALMETTO_HEIGHT_OPTIONS.map((height, i) => ( | ||
<tr key={i}> | ||
<td><code>{`size-height-${height}`}</code></td> | ||
<td><code>{height}</code></td> | ||
<td>{PALMETTO_HEIGHT_VALUES[i].value}</td> | ||
<td>{height === 'base' ? '16' : PALMETTO_HEIGHT_VALUES[i].value.includes('%') ? '' : PALMETTO_HEIGHT_VALUES[i].original.value * 16}</td> | ||
<td>{PALMETTO_HEIGHT_VALUES[i].original.comment}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
|
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,37 @@ | ||
import { Meta } from '@storybook/addon-docs/blocks'; | ||
import sizes from '@palmetto/palmetto-design-tokens/build/js/variables-size'; | ||
import { PALMETTO_WIDTH_OPTIONS, PALMETTO_WIDTH_VALUES } from '../lib/tokens'; | ||
|
||
<Meta | ||
title="Design Tokens/Width" | ||
/> | ||
|
||
# Width | ||
|
||
Standard widths have been defined based on percentages or `rem`. | ||
|
||
Rem based values will scale when adjusting the root font size. Pixel values are calculated with a root font size of `16px`. | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>token name</th> | ||
<th>prop value</th> | ||
<th>value</th> | ||
<th>px</th> | ||
<th>notes</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{PALMETTO_WIDTH_OPTIONS.map((width, i) => ( | ||
<tr key={i}> | ||
<td><code>{`size-width-${width}`}</code></td> | ||
<td><code>{width}</code></td> | ||
<td>{PALMETTO_WIDTH_VALUES[i].value}</td> | ||
<td>{width === 'base' ? '16' : PALMETTO_WIDTH_VALUES[i].value.includes('%') ? '' : PALMETTO_WIDTH_VALUES[i].original.value * 16}</td> | ||
<td>{PALMETTO_WIDTH_VALUES[i].original.comment}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
|
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