Border width cleared for individual sides shows correctly in editor but renders full border on frontend
Description
I encountered a mismatch between the editor view and the frontend output when modifying border widths for a Paragraph block.
After clearing border width values for specific sides, the editor preview reflects the change correctly, but the frontend still renders borders on all four sides.
This results in inconsistent rendering between editor and frontend.
Step-by-step reproduction instructions
-
Add a core Paragraph block.
-
Enter some text.
-
Apply:
- Background color
- 2px solid black border on all sides.
-
Save the post and verify on the frontend -> rendering is correct.
-
Go back to the editor and:
- Split border controls into individual sides.
- Clear the width values for left, right, and bottom borders.
- Leave only the top border width defined.
-
Observe:
- Editor view: shows only the top border (correct).
- Frontend view: still displays all four borders.
Screenshots, screen recording, code snippet
https://github.com/user-attachments/assets/1fc3c9b3-31b4-4988-984a-865ee393378e
Environment info
No response
Please confirm that you have searched existing issues in the repo.
- [x] Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- [x] Yes
Please confirm which theme type you used for testing.
- [x] Block
- [ ] Classic
- [ ] Hybrid (e.g. classic with theme.json)
- [ ] Not sure
A fix for this has been merged via #75546.
There is further discussion around the nuances of this issue in https://github.com/WordPress/gutenberg/pull/75431#issuecomment-3902750972