-
Notifications
You must be signed in to change notification settings - Fork 114
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
[Woo POS] [Design System] Create a color palette for POS and corresponding SwiftUI colors #15063
Conversation
Generated by 🚫 Danger |
|
…r future color palettes in the main bundle. Update color code.
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.
LGTM! 🚢
Great change! Much much easier to work with colors with the palette rather than code-only. |
@@ -0,0 +1,54 @@ | |||
import SwiftUI | |||
|
|||
extension Color { |
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.
So many colors 😀 Fingers crossed it will be comfortable to work with 🤞
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.
31 new colors 😄 as long as the design uses it, it's been great not having to worry about dark mode.
Part of #15061
Description
This pull request introduces a new color palette for POS based on the Design System table 1qcjzXitBHU7xPnpCOWnNM-fi-19_19221 / color roles 1qcjzXitBHU7xPnpCOWnNM-fi-437_20681. The changes include the addition of new color definitions in Swift and corresponding color assets as an Xcode color asset catalog. The new colors are not used in the code yet, they will replace existing POS colors in future PRs to keep reasonably sized PRs.
I decided to go with a color palette instead of all code, for easier visualization of both light and dark mode colors and because these colors are not meant to be dynamic (at least for now). We can easily compare the colors with the design system and update them in the future.
New color definitions:
WooCommerce/Classes/POS/Colors/Color+POSColorPalette.swift
: Added an extension to theColor
class defining various POS-specific colors such as primary, secondary, surface, and status colors.New color assets:
WooCommerce/Classes/POS/Colors/POSColorPalette.xcassets
: Added the main contents file for the color assets. There are 31 colors from the design system table.Steps to reproduce
I'd recommend testing the PR by reviewing the
POSColorPalette
color catalog, where most of the diffs are from. You can compare each color with the corresponding one in 1qcjzXitBHU7xPnpCOWnNM-fi-19_19221 / color roles 1qcjzXitBHU7xPnpCOWnNM-fi-437_20681 (the names in the catalog are lowerCamelCase but I'm open to changing it if it helps with readability). I also named the colors with apos
prefix to avoid potential conflicts with future color palettes.Testing information
If you'd like to try any of the new colors, feel free to try returning
.posTextPrimary
forposPrimaryText
color for example.Screenshots
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: