-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Revert the button block to the previous markup #21923
Conversation
Size Change: +1.25 kB (0%) Total Size: 818 kB
ℹ️ View Unchanged
|
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.
It seems on this PR when I apply a predefined color with 2020 the color is not viewable on the editor. The same also happened on master but it does not happen on WordPress 5.4. I wonder if the colors not being applied was a regression from #21266 that we are keeping?
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 verified that the markup of the blocks is the same that we had on 5.4 and I did not found any regression when comparing against master.
While I'm unable to reproduce it on master, I do see the same issue. Interestingly, I think it's a side-effect of the fact that this "fixes" theme styling (#21917, #21909). You can see in the screenshot below that the color from theme styles (from TwentyNineteen) has a higher specificity than the predefined color styling: Like you, I did find that it worked as expected on the front-end. In fact, the changes here help restore theme styles which were not working correctly after #21266, in addition to using the correct predefined color assigned to the button. As far as interoperability with the specific theme styles I'm seeing, I think this is in a better state than |
It appears this may be theme-dependent. On TwentyTwenty, I see the same problems with predefined colors not taking effect in the editor, both on this branch and on |
@jorgefilipecosta @aduth are you testing with the mu-plugins that disable colors enabled or not? this could have an impact here. |
@youknowriad I am. But even disabling the behavior of it, the problem persists. |
This is the best thing to do but it doesn't guarantee the styles will work. In the current structure the modifiers (.is-style-outline) get applied to the wrapper, and not the button itself, so you still have to do some CSS gymnastics to make it work consistently for new and old structures. |
Hehe, I just finished refactoring the styles to match the new-old button markup. 😄 |
@strarsis that's a good thing because in theory they work on both markups right? and it's a win if it ever becomes new again 😬 |
Will it stay lke that?
|
The button markup change in #21266 created some backward compatibility issues for theme authors. Noting that we were aware of these breakage (styling for new buttons on the frontend), but sometimes hard decisions are required. This markup change was specially important for Global styles. But since the Global styles project is not shipped as stable yet, this PR reverts the markup change to give us more time before this potential breaking change. I'd still encourage theme authors to update their styles to only rely on
wp-block-button__link
without requiring the presence of awp-button
parent or not which would make the styles work regardless of the chosen markup in the end.closes #21917
closes #21909