-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storybook: Add stub doc on existing colors. #65982
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6a119f8
Storybook: Add stub doc on existing colors.
jasmussen 582885c
Update 4.6 to 4.5 for contrast.
jasmussen ebcfa1e
Update based on feedback.
jasmussen e5fb170
Use SCSS also for the alerts.
jasmussen 084c8e8
Separate white and black.
jasmussen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,61 @@ | ||
import { Meta, ColorPalette, ColorItem } from '@storybook/blocks'; | ||
|
||
<Meta title="Tokens/Color" name="page" /> | ||
|
||
# Color | ||
|
||
This document outlines the default color set of the WordPress component system as it ships. The page is a work in progress. | ||
|
||
## Colors | ||
|
||
<ColorPalette> | ||
<ColorItem | ||
title="Black & White" | ||
subtitle="" | ||
colors={{ | ||
'$black': '#000', | ||
'$white': '#fff', | ||
}} | ||
/> | ||
</ColorPalette> | ||
|
||
<ColorPalette> | ||
<ColorItem | ||
title="Gray Tones" | ||
subtitle="" | ||
colors={{ | ||
'$gray-900': '#1e1e1e', | ||
'$gray-800': '#2f2f2f', | ||
'$gray-700': '#757575', | ||
'$gray-600': '#949494', | ||
'$gray-400': '#ccc', | ||
'$gray-300': '#ddd', | ||
'$gray-200': '#e0e0e0', | ||
'$gray-100': '#f0f0f0', | ||
}} | ||
/> | ||
</ColorPalette> | ||
|
||
<ColorPalette> | ||
<ColorItem | ||
title="Alert colors" | ||
subtitle="" | ||
colors={{ | ||
'$alert-yellow': '#f0b849', | ||
'$alert-red': '#cc1818', | ||
'$alert-green': '#4ab866', | ||
}} | ||
/> | ||
</ColorPalette> | ||
|
||
## Contrast | ||
|
||
Ensure proper contrast is met between text, icons, UI, and backgrounds. Text needs to meet a 4.5:1 ratio to meet AA standards, while large text (16px+) and UI elements (borders, etc.) need to meet a 3:1 ratio. In this section is a list of tokens you can use to meet these criteria. | ||
|
||
Against a white background: | ||
|
||
* **Gray 700**\ | ||
Lightest gray you can use and meet 4.5:1 text contrast. | ||
|
||
* **Gray 600**\ | ||
Lightest gray you can use and meet 3:1 UI contrast. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this document (and following ones) are a WIP, should we make less discoverable? Maybe we could change the file path to something like
storybook/stories/_system/tokens/color.mdx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I would prefer not to, because even if the document, and followups of the same type, are meant to be stubs and starting points, they should nevertheless be immediately useful, and document what's already shipping. In this case, these colors are just extracted from base styles, but are more easily digestible here.
However I'm happy to defer to opinions otherwise, and move it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion either. Maybe @mattrwalker can help, as he recently worked on the Storybook's site map?
In any case, not a blocking comment. Any changes that we discuss can be applied in follow-up PRs.