-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update design/color page #8840
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
Merged
Merged
Update design/color page #8840
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0ff4bd2
Update design/color page
alex-page 7593ebf
Merge branch 'main' into design/color-update
alex-page 00b2d50
Add color swatches to Color page
sam-b-rose bcfd130
Remove colors.scss and gen-colors.mjs
sam-b-rose 24ffc32
Add changeset
sam-b-rose e4588dc
Remove repeating markdown
sam-b-rose 736c4b8
Fix type check issues
sam-b-rose 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 hidden or 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,5 @@ | ||
| --- | ||
| 'polaris.shopify.com': patch | ||
| --- | ||
|
|
||
| Updated Colors page with v11 content |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,111 +1,84 @@ | ||
| --- | ||
| title: Colors | ||
| description: Our color system builds on the recognition of the Shopify brand colors to make the admin interface more usable. | ||
| title: Color | ||
| description: Color is a powerful tool that helps merchants quickly navigate and manage their businesses in the Shopify Admin. | ||
| icon: ColorsMajor | ||
| keywords: | ||
| - visual patterns | ||
| - color strategy | ||
| - color use | ||
| --- | ||
|
|
||
|  | ||
|  | ||
|
|
||
| --- | ||
|
|
||
| ## Principles | ||
| ## Using color | ||
|
|
||
| ### Communication is key | ||
|  | ||
|
|
||
| Although we value an aesthetically pleasing use of color, we place a higher value on clear communication. Color supports the purpose of the content, communicating things like hierarchy of information, interactive states, and the difference between distinct elements. | ||
| ### 1. Reinforce the purpose of the page | ||
|
|
||
| ### Colors have meaning | ||
| Always use color that supports the purpose of the content and the overall goal of the page. Color can help communicate things like hierarchy of information, interactive states, and distinct elements, all of which make it easier for merchants to get their work done. | ||
|
|
||
| Colors have assigned roles, which hold a specific meaning based on how they function within the interface. Defined color roles make things easy to modify and customize later. They also extend the color system so it works across any touchpoint at Shopify. | ||
| ### 2. Design accessible experiences | ||
|
|
||
| ### Colors follow accessibility guidelines | ||
| The color system is designed to meet WCAG 2.1 contrast ratios. Sufficient contrast makes things easier to find, identify, and interact with for all merchants. However, you should never convey information using color alone. For example, using an icon or a label in addition to using red, yellow, or green when communicating the status of something ensures that the status is visible to merchants who are color blind. | ||
|
|
||
| The color system is designed within the HSLuv color space to generate themes that meet WCAG 2.1 compliant contrast ratios. This makes things easier to find, identify, and interact with. It also makes the whole experience more accessible for merchants who are color blind or who have low vision. However you should never convey information using color alone. | ||
| ### 3. Create heirarchy | ||
|
|
||
| --- | ||
|
|
||
| ## Color roles | ||
|
|
||
|  | ||
|
|
||
| We define colors based on the role they play in the interface. There are 10 color roles, which we use to generate the values of all the color variants in the palette. | ||
|
|
||
|  | ||
|
|
||
| ### Color variants | ||
|
|
||
| Color variants are variables that apply color to the UI, and their values are generated from the color roles. Color variants are available as tokens. | ||
|
|
||
|  | ||
|
|
||
| Variants share a naming pattern that references their color role, the interaction state they define, and any UI elements they’re linked to. | ||
| Color plays a key role in creating the overall hierarchy of a screen. Using the subdued and strong token variants is an easy way to change that hierarchy and draw a merchant's attention to the right place. | ||
|
|
||
| --- | ||
|
|
||
| ## The color system in action | ||
|
|
||
| How the color roles relate to the variants, and how they’re applied across the interface. | ||
|
|
||
| ### Surface | ||
|
|
||
| Surface colors affect surfaces of components, such as page, card, sheet, and popover. | ||
|
|
||
|  | ||
|
|
||
| ### On surface | ||
|
|
||
| Apply on-surface colors to elements that appear on neutral surfaces, usually borders, secondary icons, and text elements. | ||
|
|
||
|  | ||
|
|
||
| ### Primary | ||
| ## Color pallette | ||
|
|
||
| Use primary colors for primary actions like buttons, icons and text on navigation and tabs, and for the background in navigation and tab interactive states. | ||
| The Polaris color palette is composed of 8 different colors, each with 10 unique shades. These colors are then used to create semantic tokens that style both Polaris components and custom components within the Shopify admin. | ||
|
|
||
|  | ||
| <!-- colors --> | ||
|
|
||
| ### Secondary | ||
| ## Tokens | ||
|
|
||
| Use secondary colors for secondary and tertiary buttons and the background of form elements. | ||
|  | ||
|
|
||
|  | ||
| Polaris provides a comprehensive suite of [color tokens](/tokens/colors) for styling each part of the user interface. These tokens are passed into components and are available via css variables to style custom UI elements within the Shopify admin. | ||
|
|
||
| ### Interactive | ||
| ### Token names | ||
|
|
||
| Use interactive colors for things like links, focus indicators, and selected interactive states. | ||
| Each color token follows the same naming convention. The purpose and intent of a color token is built into the name itself. This makes it easy to understand how and when any given token should be used. | ||
|
|
||
|  | ||
| **Naming formula:** `--p-color-element-role-variant-state` | ||
|
|
||
| ### Success | ||
| **Example:** `--p-color-bg-critical-subdued-hover` | ||
|
|
||
| Success colors indicate something positive, like the success of a merchant action or to illustrate growth. | ||
| | Name space | Description | Examples | | ||
| | ---------- | --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | | ||
| | Element | This refers to the actual UI element being styled. | bg, text, icon & border | | ||
| | Role | Assigned roles to specific colors to ensure consistent communication of color throughout the admin. | interactive, caution, success, primary, critical, info & magic | | ||
| | Variant | This is the key descriptor of a token that communicates exactly what this token is to be used for. | subdued, strong, on-color, inverse | | ||
| | State | Communicates the state on which this token is applied. | hover, active, selected, disabled & focus | | ||
|
|
||
|  | ||
| The element slot is the only one that is required. When there is no role, variant or state associated with a token those slots are omitted from the final token name. | ||
|
|
||
| ### Warning | ||
| ### Examples | ||
|
|
||
| Warning colors let the merchant know they need to take action, and are applied to badges, banners, and exception lists. | ||
|  | ||
|
|
||
|  | ||
| ## Applying tokens | ||
|
|
||
| ### Critical | ||
| ### Using color roles | ||
|
|
||
| Critical colors are for destructive interactive elements, errors, and critical events that require immediate action. | ||
| Colors have assigned roles, which hold a specific meaning based on how they function within the interface. Using these color roles correctly brings consistency across the admin, making it easier for merchants to work. | ||
|
|
||
|  | ||
|  | ||
|
|
||
| ### Highlight | ||
| ### Variants | ||
|
|
||
| Highlight colors indicate important elements that don’t require immediate action. They’re used with informational banners and badges, indicators that draw attention to new information, loading or progress bars, and data visualization. | ||
| Use variants to create hierarchy within the experience. Strong variants put emphasis on an element while subdued variants push them more into the background. | ||
|
|
||
|  | ||
|  | ||
|
|
||
| ### Decorative | ||
| ### Interaction states | ||
|
|
||
| Decorative colors are for expressive communications that assert the Shopify brand presence. | ||
| State tokens make interactions clear to merchants as they manage their store. | ||
|
|
||
|  | ||
|  |
Binary file modified
BIN
+7.32 KB
(120%)
polaris.shopify.com/public/images/design/colors/color-intro@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-44.9 KB
polaris.shopify.com/public/images/design/colors/color-role-critical@2x.png
Binary file not shown.
Binary file removed
BIN
-20.2 KB
polaris.shopify.com/public/images/design/colors/color-role-decorative@2x.png
Binary file not shown.
Binary file removed
BIN
-45.8 KB
polaris.shopify.com/public/images/design/colors/color-role-highlight@2x.png
Binary file not shown.
Binary file removed
BIN
-34.2 KB
polaris.shopify.com/public/images/design/colors/color-role-interactive@2x.png
Binary file not shown.
Binary file removed
BIN
-26.5 KB
polaris.shopify.com/public/images/design/colors/color-role-onsurface@2x.png
Binary file not shown.
Binary file removed
BIN
-19.4 KB
polaris.shopify.com/public/images/design/colors/color-role-primary@2x.png
Binary file not shown.
Binary file removed
BIN
-18.4 KB
polaris.shopify.com/public/images/design/colors/color-role-secondary@2x.png
Binary file not shown.
Binary file removed
BIN
-19.3 KB
polaris.shopify.com/public/images/design/colors/color-role-success@2x.png
Binary file not shown.
Binary file removed
BIN
-47.9 KB
polaris.shopify.com/public/images/design/colors/color-role-surface@2x.png
Binary file not shown.
Binary file removed
BIN
-59 KB
polaris.shopify.com/public/images/design/colors/color-role-warning@2x.png
Binary file not shown.
Binary file modified
BIN
+74.7 KB
(380%)
polaris.shopify.com/public/images/design/colors/color-roles@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.9 KB
polaris.shopify.com/public/images/design/colors/color-token-naming-example@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+72.4 KB
polaris.shopify.com/public/images/design/colors/color-usage-123@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-10.9 KB
polaris.shopify.com/public/images/design/colors/color-variant-naming@2x.png
Binary file not shown.
Binary file modified
BIN
+43.4 KB
(210%)
polaris.shopify.com/public/images/design/colors/color-variants@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+88.5 KB
polaris.shopify.com/public/images/design/colors/interaction-states@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.