Repository navigation
wpcomsh: Keep gifting banner buttons readable under theme styles and long labels - #54668
Merged
Merged
Conversation
…long labels Theme and page-builder button rules (Elementor's site kit, Hello Elementor's focus style, Twenty Twenty) outranked the banner's single-class selectors, so the "?" turned into a coloured box offset from its icon and the Gift button took the theme's colours. Scope both buttons to the banner ID and reset inherited styles. The Gift button also had a fixed height and could shrink, so multi-word labels such as Turkish "Hediye et" wrapped and were clipped on mobile. Keep the label on one line and let the button size to it. Give the "?" button an accessible name, and bump the wpcom-path asset version so cached copies refresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Contributor
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code Coverage SummaryCoverage changed in 1 file.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverts the more_info check: no other localized-data read in the monorepo guards against a stale page cache, and the lapse is brief. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pages cached before the deploy can load this script with data that has no more_info, which would set aria-label to "undefined". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The phone subtitle line is 15px tall, so the 22px "?" box pushed the icon below the text and made the banner taller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On narrow screens it could wrap onto a line of its own, which happened more often once the Gift button stopped shrinking. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Atomic sites whose plan is about to expire show visitors a black banner: "Enjoy this site? Gift the author a WordPress.com plan.", followed by a "?" link to the gifting docs and a white "Gift" button. Both buttons were styled with single-class selectors, so a theme's or page builder's own button rules beat them. Under Elementor's site kit, Hello Elementor or Twenty Twenty, the "?" turns into a coloured padded box with its icon drawn outside it, and "Gift" takes the theme's colours.
The Gift button also had a fixed height and was allowed to shrink. On phones, two-word translations ("Hediye et", "Cadeau geven", "Berikan hadiah") wrapped onto a second line that was cut off. Separately, the "?" button had no text, so screen readers announced it only as "button".
Proposed changes
The same fix is being made to the WordPress.com copy of this banner; the two files are kept in sync.
Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Screenshots
Hello Elementor with an Elementor kit that colours buttons.
Turkish at 360px, on a theme that leaves buttons unstyled (the banner's own CSS only).
Testing instructions
Prerequisites: an Atomic site running wpcomsh from this branch, with a paid plan, the Hello Elementor theme, and the Elementor plugin with a kit that sets a button background colour (Site Settings › Buttons).
Theme button styles
wp option update wpcom_gifting_subscription 1Long labels on mobile
Accessible name
aria-label="Learn more".🤖 Generated with Claude Code