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

Add wp-block-paragraph class to core/paragraph block #57195

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

hbhalodia
Copy link
Contributor

What?

Issue - #46863

Why?

  • By this PR, we are adding the common class name to the core/paragraph block, so that global styles that change for core/paragraph block applies only for that particular block and not to any other core/block.

How?

  • This PR adds the new class wp-block-paragraph to all core/paragraph block. Validation error is being handled by adding this class using render_callback same as for heading block.

Testing Instructions

  1. Open the site editor.
  2. Go to any template or parts.
  3. Go to styles section and change the global style for the core/paragraph block.
  4. You can see that it only affects the core/paragraph block, earlier it was not the case.
  5. Refer to the recording for before and after change.

Testing Instructions for Keyboard

  • None.

Screenshots or screencast

Before

Before.Fix.-.core_paragraph.webm

After

After.Fix.-.Core_Paragraph.webm
This is fixed for the issue WordPress#46863, when any change to global style is added it gets effected to all the elements which have <p> tag, instead of only paragraph. So other blocks like site title was getting changed too.
Copy link

github-actions bot commented Dec 19, 2023

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: [Block] Paragraph.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@skorasaurus skorasaurus added the [Block] Paragraph Affects the Paragraph Block label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Paragraph Affects the Paragraph Block
2 participants