Skip to content
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

DropdownMenu V2: use themed color variables #64647

Merged
merged 6 commits into from
Aug 21, 2024

Conversation

ciampo
Copy link
Contributor

@ciampo ciampo commented Aug 20, 2024

What?

Related to #50971

Update DropdownMenuV2 styles to use as much as possible themed color variables, instead of hardcoded ones

Why?

Aiming for greater consistency across our UIs by having shared colors and codified guidelines.

How?

Updating styles in DropdownMenu v2

Testing Instructions

Load storybook, make sure that the dropdown menu v2 examples keep looking as before

Note

Any theming applied in Storybook (via the dedicated top toolbar menu) won't apply to the dropdown menu popover, since it's portaled in a part of the page that doesn't have the theme variables in scope (cc @mirka )

@ciampo ciampo requested a review from ajitbohra as a code owner August 20, 2024 14:40
@ciampo ciampo self-assigned this Aug 20, 2024
@ciampo ciampo added the [Package] Components /packages/components label Aug 20, 2024
Copy link

github-actions bot commented Aug 20, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <[email protected]>
Co-authored-by: mirka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ciampo ciampo requested review from jameskoster and a team August 20, 2024 14:40
@ciampo ciampo added the [Type] Enhancement A suggestion for improvement. label Aug 20, 2024
const DEFAULT_BORDER_COLOR = COLORS.gray[ 300 ];
const DIVIDER_COLOR = COLORS.gray[ 200 ];
const TOOLBAR_VARIANT_BORDER_COLOR = COLORS.gray[ '900' ];
// - border color and divider color are different from COLORS.theme variables
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #64649 to discuss this separately

Comment on lines +29 to +30
// - lighter text color is not defined in COLORS.theme, should it be?
// - lighter background color is not defined in COLORS.theme, should it be?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe these two questions are trivial enough that I can add those variables directly in the PR, if folks agree.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling we shouldn't be doing too much abstracting or "semanticizing" right now, and rather wait until the design folks are ready with a new token system. I'm assuming this color system in the Figma is still WIP, but in any case the token system there is very different from the one we currently have in @wordpress/components.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's definitely true that the priority is to make such progress directly on the theme effort, which will then represent the source of truth for those design tokens.

I thought we could have a temporary internal set of variables to help with consistency and with the refactor to the new design tokens, but I'm also completely fine leaving the code as-is.

Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🚀

@ciampo ciampo force-pushed the feat/dropdown-menu-v2/tweak-styles branch from 2f89729 to d9d4ff0 Compare August 21, 2024 10:43
@ciampo ciampo enabled auto-merge (squash) August 21, 2024 10:43
@ciampo ciampo merged commit cc8009e into trunk Aug 21, 2024
61 checks passed
@ciampo ciampo deleted the feat/dropdown-menu-v2/tweak-styles branch August 21, 2024 11:18
@github-actions github-actions bot added this to the Gutenberg 19.1 milestone Aug 21, 2024
bph pushed a commit to bph/gutenberg that referenced this pull request Aug 31, 2024
* Use foreground theme color instead of hardcoded gray 900

* Use shared theme variable for gray 700 text

* Use theme variables for remaining colors.gray variables

* Update comments

* Extract lighter background color

* CHANGELOG

---

Co-authored-by: ciampo <[email protected]>
Co-authored-by: mirka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants