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

Components: Fix UnitControl disabled style is overridden by WP forms.css #45250

Merged
merged 3 commits into from
Oct 25, 2022

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Oct 24, 2022

What?

This PR fixes a problem where the disabled style of UnitControl is overridden by the style in the core forms.css.

Why?

As shown in the screencast below, WordPress admin style is applied by the priority of CSS specificity.

dd8e35a7fb9108118785707a4c0844c1.mp4

How?

Changed && to &&& for one more CSS specificity in the component.

Testing Instructions

  • On the Storybook, set disabled property of UnitControl to true.
  • Confirm that the appearance doesn't change when WordPress styles are injected.

Note: The font family will change, but this is a matter of inheritance and expected behavior.

@t-hamano t-hamano changed the title Components: Fix UnitControl disabled style is overridden by common style Components: Fix UnitControl disabled style is overridden by core form style Oct 24, 2022
@t-hamano t-hamano marked this pull request as ready for review October 24, 2022 14:28
@t-hamano t-hamano requested a review from ajitbohra as a code owner October 24, 2022 14:28
@t-hamano t-hamano added the [Package] Components /packages/components label Oct 24, 2022
@t-hamano t-hamano self-assigned this Oct 24, 2022
@t-hamano t-hamano requested review from mirka and ciampo October 24, 2022 14:28
@t-hamano t-hamano changed the title Components: Fix UnitControl disabled style is overridden by core form style Components: Fix UnitControl disabled style is overridden by WP forms.css Oct 24, 2022
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

Changes LGTM, thank you @t-hamano !

Test failures don't seem related, but this PR will need a rebase in order for the PHP unit tests check to pass (see #45265 )

Edit: I had originally linked to the wrong PR!

@aristath aristath force-pushed the fix/unit-control-core-override branch from 401cf34 to ef554e1 Compare October 25, 2022 09:11
Copy link
Member

@aristath aristath left a comment

Choose a reason for hiding this comment

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

Thank you for working on this @t-hamano!

Changes look good to me 👍
I rebased the PR, let's see if tests pass now.

@t-hamano t-hamano force-pushed the fix/unit-control-core-override branch from ef554e1 to f2bf3f2 Compare October 25, 2022 11:20
@t-hamano
Copy link
Contributor Author

Thank you for the review @ciampo, @aristath !

@aristath
Perhaps it was before the #45265 was merged, which fixes the test failure.
I have confirmed that it has been merged and I have rebased it again 👍

@t-hamano t-hamano merged commit 464788b into trunk Oct 25, 2022
@t-hamano t-hamano deleted the fix/unit-control-core-override branch October 25, 2022 12:27
@github-actions github-actions bot added this to the Gutenberg 14.5 milestone Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants