Global Styles: Add textShadow style support#73320
Conversation
| // Reset the text shadow from the global styles. | ||
| text-shadow: none; |
|
Size Change: +51 B (0%) Total Size: 7.51 MB 📦 View Changed
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
aaronrobertshaw
left a comment
There was a problem hiding this comment.
Thanks for all the work on this @t-hamano 👍
This might just be me but splitting up the changes for the block support here, makes it much harder to actually confirm that all the places required have been updated.
Reviewing the changes as they are currently though there are a couple of minor issues:
- Need to update: docs/reference-guides/theme-json-reference/styles-versions.md
- Text shadow should be added to the
VALID_SETTINGSin the theme.json class too - Needs to update docs/reference-guides/theme-json-reference/theme-json-living.md for settings after update above
- Once setting for text shadow has been added we also need a default setting value in
lib/theme.json - Also, it looks like the style engine's PHP typography config hasn't been updated here or in #71419
|
@aaronrobertshaw Thanks for the review!
This is the main reason why I split the tasks. Also, since this PR is solely focused on style, I purposely left out the settings. That said, if addressing everything at once is easier, I'm happy to prioritize #71419 👍 |
Add the missing textShadow property to the typography branch of the Style type so external typed consumers don't hit type errors when using the new text-shadow style support. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The default block appender renders its prompt ("Type / to choose a block")
as a real paragraph-styled element, so the global text-shadow style was
applied to it until the block was selected. Reset text-shadow to none,
matching the existing rich text placeholder reset.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Cover the textShadow style alongside the existing textDecoration and textTransform cases in both the compileCSS and getCSSRules tests, so the new text-shadow support is guarded against regressions. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Drop the temporary TODO note; it was a placeholder and not an actual backport changelog entry. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
@aaronrobertshaw Thanks for the feedback!
Yes, here are all the follow-up tasks I could think of: #47904 (comment)
I have fixed all of these. |
…pport # Conflicts: # packages/style-engine/src/test/index.js
|
This is testing well for me. Thanks for linking to the follow ups. Also, would we need to update docs/reference-guides/theme-json-reference/styles-versions.md ? |
I'm guessing the UI will be the slowest/trickiest bit to get right. I'm happy for this to get in with the block level support/controls as a follow up. Though the preference would be to ship the entire feature (global styles + block supports) if it gets into 7.1. Is there enough time for that? What do folks think? |
Mirror the JS style engine, which already maps textShadow to the text-shadow CSS property, to keep JS/PHP parity. Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Nice catch, updated in 858347e. Additionally, I fixed an issue with the style engine lacking support in b33baa3. |
With three weeks left until Beta1, but implementation should not take long as there is precedent code. Specifically, the shadow preset UI should be reusable almost as-is for the text shadow preset UI.
The UI for block instances has also been sufficiently discussed here. #47904 (comment) If it takes time, it will likely be about deciding on the default presets, which tend to be the most divisive. However, even if everything doesn't make it in time for 7.1, I believe it's still worthwhile to ship the style support alone. |
|
@aaronrobertshaw, do you have any concerns before merging this PR? |
aaronrobertshaw
left a comment
There was a problem hiding this comment.
I've given this another smoke test in particular around the placeholder reset and my recent review items.
LGTM 🚢
|
Thank you both! I'd like to merge this PR and move on to the remaining tasks. P.S. This PR might be worth mentioning as part of the Misc Dev note. |
|
A follow-up PR addressing the remaining tasks: WordPress/wordpress-develop#12011 |





text-shadowoption support in Typography Panel #71419What?
This PR allows
text-shadowCSS styles to be defined in theme.json.Why? How?
Looking at #47904, the Text Shadow support seems to be a feature requested by many users.
However, to fully implement this, we need to discuss the following at least:
This PR is the first small feature improvement, allowing us to simply define
text-shadowunder thestyles.typography.Testing Instructions
For example, use a theme.json like the one below and make sure it works correctly in all scenarios:
{ "$schema": "../../schemas/json/theme.json", "version": 3, "settings": { "appearanceTools": true, "layout": { "contentSize": "840px", "wideSize": "1100px" } }, "styles": { "typography": { "textShadow": "1px 1px 2px red, 0 0 1em blue, 0 0 0.2em blue;" }, "blocks": { "core/paragraph": { "typography": { "textShadow": "1px 1px 2px red, 0 0 1em red, 0 0 0.2em red;" } } }, "elements": { "link": { ":hover": { "typography": { "textShadow": "none" } } } } } }Screenshots or screencast