-
Notifications
You must be signed in to change notification settings - Fork 875
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
(new) Improve the upsell button caret icon position in RTL languages #11398
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR done. Found two minor things.
admin/class-premium-popup.php
Outdated
@@ -77,8 +77,10 @@ public function get_premium_message( $popup = true ) { | |||
$assets_uri = trailingslashit( plugin_dir_url( WPSEO_FILE ) ); | |||
|
|||
/* translators: %s expands to Yoast SEO Premium */ | |||
$cta_text = sprintf( __( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' ); | |||
$classes = ''; | |||
$cta_text = sprintf( __( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we do esc_html__
here like https://github.com/Yoast/wordpress-seo/pull/11398/files#diff-298aab7b9ea9a84b3500fdad7618ca6dR63
admin/class-premium-popup.php
Outdated
$cta_text = sprintf( __( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' ); | ||
$classes = ''; | ||
$cta_text = sprintf( __( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' ); | ||
$new_tab_message = '<span class="screen-reader-text">' . __( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment above. On https://github.com/Yoast/wordpress-seo/pull/11398/files#diff-298aab7b9ea9a84b3500fdad7618ca6dR64 it is escaped
2nd CR 👍 |
@afercia There are three more places:
I've added them to your PR description |
Comparing side by side what my screenshots and the ones from @IreneStr I see the actual font used is different. It's very evident especially for some letters, see for example the shape of This seems to be caused by the font stack used on the button: @IreneStr do you have any "Open Sans" or "Arial" fonts installed in your system fonts? On macOS you can check the fonts in the "Font Book" app. I think the only thing we can try is to mitigate the problem tweaking the line-height. |
Aside: why are we using |
I've installed in my system fonts Open Sans from Google fonts and I can reproduce the misalignment now. Hard to fix. The root issue is we're using a font that is not installed by default on maOS nor Windows. (not sure about *nix distros). |
I've committed a temporary fix to not use "Open Sans" on the Upsell button. We should consider to remove any non-default-system-font, will create a new issue. |
A bit of historical background can help. In the plugin, the font stack that uses Open Sans comes from the inclusion of files that were originally developed for yoast.com. However, the plugin is not using Google Fonts to actually include Open Sans so these font stacks are pointless, including the one that uses Merriweather. Additionally, they're not only pointless but they create problems when users have manually installed these fonts (for any reasons) in their system. I've removed the 1 pixel top margin from the caret. Notice the rendering is different in Firefox, and the alignment won't look perfect. Also, the icon doesn't help because it has white space around the shape. The button overlapping content is a pre-existing unrelated issue due to the button container implementation. I'll see what can be done. @Dieter have you checked if you have "Open Sans" installed in your system fonts and, if so, have you uninstalled as I've recommended on Slack? In your screenshot I see the purple title has a lighter weight than expected: it should be bolder: While your one is clearly different: |
I'm boy-scouting the overlapping issue by removing the absolute positioning of the button container. That didn't take into account the case of taller buttons when their content goes in two or more lines. The "cards" are now flex items of their container an also flex containers for their content, to the content can be layout vertically using
Screenshot with an intentionally exaggerated edge case: |
CR done 👍 |
Acceptance 👍 |
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
<span>
element so it behaves like inline contentinline-flex
so the text and the icon are better aligned verticallyyoast-button-upsell
also in the Extensions pageTest instructions
The upsell button needs to be checked everywhere it appears, and also in the responsive view. As far as I know, it is used:
wp-admin/admin.php?page=wpseo_licenses
All these places need to be tested in LTR and RTL.
Example screenshot:
Fixes #11174