Repository navigation
Use correct translation function for assistive text - #12011
Merged
Merged
Conversation
ocean90
approved these changes
Nov 17, 2018
ocean90
reviewed
Nov 17, 2018
t-hamano
added a commit
that referenced
this pull request
Sep 10, 2026
* Block Supports: Add textShadow typography support and UI
Introduce a `typography.textShadow` block support backed by text shadow
presets, end to end:
- Register the `textShadow` typography support key and gate it per block;
enable it on the paragraph and heading blocks.
- Add `settings.typography.textShadow` and `textShadowPresets` to
theme.json (defaults, schema, PHP/JS registration) and reuse the
box-shadow parser for text shadow values.
- Add the Global Styles preset management UI (preview, list, create,
rename, delete, reset) under Typography, plus a text shadow control in
the typography panel for both the block inspector and Global Styles.
Presets follow the same model as the other typography preset supports
(font size, font family) rather than the box-shadow inline model: the
chosen preset slug is stored in a dedicated top-level `textShadow`
attribute and emitted as a `has-{slug}-text-shadow` utility class, so
preset selection stays out of the inline style and the generated preset
stylesheet drives the value. Custom (non-preset) values still serialize
inline on `style.typography.textShadow`.
Co-Authored-By: Claude <noreply@anthropic.com>
* Text shadow: Update getSupportedStyles tests for textShadow
`textShadow` was added to the global supported style list without an
element exclusion, so it is now reported for every element and the
global default. Update the expected lists in the getSupportedStyles
tests to include `textShadow`.
Co-Authored-By: Claude <noreply@anthropic.com>
* Text shadow: Add backport changelog entry for this PR
Record gutenberg PR #79584 against the wordpress-develop #12011 backport
so the text shadow support changes are tracked for Core backporting.
Co-Authored-By: Claude <noreply@anthropic.com>
* Text shadow: Add PHP test for preset classname generation
Cover the server-side path that turns a `textShadow` preset attribute into
a `has-{slug}-text-shadow` class, mirroring the existing font family
classname test, so the class-based serialization stays protected.
Co-Authored-By: Claude <noreply@anthropic.com>
* Text shadow: Add textShadow boolean to TypographySettings type
The `TypographySettings` type gained `textShadowPresets` and
`defaultTextShadowPresets` but not the `textShadow` boolean that gates the
control and exists in the theme.json schema and PHP valid settings, so the
type was internally inconsistent for the feature. Add it.
(The type predates this PR and is still missing several unrelated
typography settings; completing it is left to a separate cleanup.)
Co-Authored-By: Claude <noreply@anthropic.com>
* Text shadow: Localize textShadowPresets preset names
Register `typography.textShadowPresets[].name` in the theme i18n schema
(top level and per-block) so theme-defined text shadow preset names are
translatable, matching font sizes, font families, and shadow presets.
Co-Authored-By: Claude <noreply@anthropic.com>
* Text shadow: Add a Default option to the preset select
When seven or more presets render the picker as a SelectControl, an unset
value showed the first preset as selected because no empty option existed.
Prepend a "Default" option so an unset text shadow is represented and
selecting it clears the value.
Co-Authored-By: Claude <noreply@anthropic.com>
* Text shadow: Add a None option to unset an inherited text shadow
The text shadow popover only let users pick a preset or reset to the
Default (inherited) value, so there was no way to explicitly remove a
text shadow inherited from theme.json or a parent level. Add a "None"
choice that sets `text-shadow: none`, giving users a way to cancel out
an upper-level text shadow. Base the compact/select display threshold on
the preset count so the added choice does not shift the cutoff.
Co-Authored-By: Claude <noreply@anthropic.com>
* Text shadow: Document the textShadow preset attribute in block supports
The typography.textShadow docs only described the custom `style`
attribute, omitting the top-level `textShadow` attribute that stores a
selected preset slug. Document both attributes, mirroring the
typography.fontSize section, so block authors know how to set a default
preset text shadow.
Co-Authored-By: Claude <noreply@anthropic.com>
* Text shadow: Resolve the selected preset by slug instead of by value
The popover matched the decoded CSS value back to a preset to determine
selection, so two presets sharing the same textShadow value would
resolve to the wrong entry. Pass the raw value through and extract the
preset slug from it (mirroring the font size pattern), using the decoded
value only for the live preview.
Co-Authored-By: Claude <noreply@anthropic.com>
* Remove redundant __next40pxDefaultSize prop from text shadow controls
SelectControl and UnitControl already default to the 40px size, so the
prop is a no-op and triggers deprecation lint warnings.
Co-Authored-By: Claude <noreply@anthropic.com>
* Remove backport changelog entry
* Global Styles: Drop redundant __next40pxDefaultSize from rename InputControl
`__next40pxDefaultSize` is now true by default for `InputControl`, so passing
it explicitly is a no-op that only adds noise.
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Migrate the presets screen to the preset management layer
Trunk's shadows preset migration (#79812) removed
`confirm-reset-shadow-dialog.tsx`, which the text shadows screen still
imported, breaking the TypeScript build. Rebuild `ScreenTextShadows` on
the same `usePresets` + `PresetGroup` layer that `ShadowsPanel` now uses,
which drops the local `TextShadowList` component and routes the reset
confirmation through `presets/dialogs/confirm-reset-dialog`.
Also drop the now single-use `__text-shadows-panel__options-container`
selector in favour of the existing `__shadows-panel__options-container`,
which `shadows-edit-panel.tsx` already uses for the same purpose.
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Align the inspector item and edit screen with trunk's shared layers
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Replace legacy layout primitives to clear eslint suppressions
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Remove a stray blank line from the VALID_SETTINGS docblock
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Add changelog entries for the affected packages
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Render the preset list as a listbox instead of menu items
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Name the target in the remove button label
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Drop the unused resetTextShadow export
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Position the remove button with offsets instead of dead auto margins
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Target 7.2.0 in the @SInCE tags for the new presets
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Add the Core backport changelog entry for 7.2
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Import kebabCase from its own package to fix the preset class name
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Build the preset list from Button and Stack for stable row heights
Co-Authored-By: Claude <noreply@anthropic.com>
* Text Shadows: Convert the new block editor files to TypeScript
* Text Shadows: Read the typography setting directly instead of unlocking a private API
* Text Shadows: Allow text-shadow in KSES so users without unfiltered_html keep the style
Co-Authored-By: Claude <noreply@anthropic.com>
* Global Styles UI: Use sentence case for 'Text shadows' labels
Co-Authored-By: Claude <noreply@anthropic.com>
* Global Styles: Define text shadow presets in em so shadows scale with font size
Co-Authored-By: Claude <noreply@anthropic.com>
* Global Styles: Drop the Outlined text shadow preset as it does not outline text
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Unlinked contributors: HatlerRyan, jnweaver, gracie, burnuser.
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: bph <bph@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: beafialho <beafialho@git.wordpress.org>
Co-authored-by: hanneslsm <hanneslsm@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>
Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>
Co-authored-by: UltimateByte <robin-labadie@git.wordpress.org>
Co-authored-by: ryanwelcher <welcher@git.wordpress.org>
Co-authored-by: karmatosed <karmatosed@git.wordpress.org>
Co-authored-by: USERSATOSHI <tusharbharti@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: kedarjoyner <kjoyner@git.wordpress.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The "%s blocks selected." message needs to use the
_n()translation function for proper internationalization. Otherwise the wording is not correct for cases where there's only 1 block selected, for example.Checklist: