-
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
Fix: apply by slug on all origins #36841
Conversation
Size Change: +216 B (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
7eac58d
to
c00b485
Compare
Rebased to fix some PHP tests that were removed from this repo and ported to WordPress core. Also pushed a fix for the inline styles that are serialized to the block to cover themes that don't enqueue styles for the editor. Without c00b485 How to test: upon selecting a preset background color for the paragraph block, in addition to the classes the block should have the inline styles as well. |
Pushed acf458c to fix the utils some blocks use (button, table, search) to serialize classes & inline styles. The inline styles we generate to cover for blocks not enqueuing their own styles were missing. |
Testing this and looking for more code changes run into another place we need to update #36886 |
96d0161
to
21c3331
Compare
21c3331
to
f6588c6
Compare
The test failures are also happening on master and don't seem related to this PR. So I'm merging it. #36886 should be addressed in a different PR. |
Co-authored-by: André <583546+oandregal@users.noreply.github.com>
@@ -67,7 +65,15 @@ export function __experimentalUseGradient( { | |||
} = {} ) { | |||
const { clientId } = useBlockEditContext(); | |||
|
|||
const gradients = useSetting( 'color.gradients' ) || EMPTY_ARRAY; | |||
const { gradients: gradientsPerOrigin } = useSetting( '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.
@jorgefilipecosta I've reopened #36770 as I still can reproduce it. |
Fix: #36770
Currently, at the block level, when we select a color/gradient from the default palette or the theme palette, if there is a custom palette, the color is applied as an inline style instead of being applied as a class or variable as it should.
These PR makes sure independently of the color palette chosen, the editor always colors and gradients with a class or CSS variable.
How has this been tested?
I went to the paragraph block and applied a background, text, and link color from the default palette. I verified background and text colors are applied using classes, and link color references a CSS variable.
I went to the group block and applied a gradient background from the default palette. I verified the background was applied using a class.
I went to the color block (a block with a specific color implementation) and applied a background color from the default palette. I verified the color was applied using a class.
I went to the color block and applied a background gradient from the default palette. I verified the gradient was applied using a class.