-
Notifications
You must be signed in to change notification settings - Fork 27
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
Theme: Add a stylesheet to be used for rosetta site overrides #380
Conversation
Some locales have translated this which generates warnings. The warnings are good, but the translators themselves are highly unlikely to ever see them (since they only appear in dev environments).
source/wp-content/themes/wporg-main-2022/src/rosetta/style.scss
Outdated
Show resolved
Hide resolved
Co-authored-by: Adam Wood <[email protected]>
@@ -95,6 +99,15 @@ function enqueue_assets() { | |||
global_fonts_preload( 'EB Garamond italic', $subsets ); | |||
} | |||
} | |||
|
|||
if ( is_rosetta_site() ) { |
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.
This is always false for me locally, I set it to true to test and the styles work
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.
Makes sense, I think I was working solely on my sandbox when I got to this part of the work. As a follow up, I'll see about adding a locale check to is_rosetta_site
here to make it work locally.
source/wp-content/themes/wporg-main-2022/src/rosetta/style.scss
Outdated
Show resolved
Hide resolved
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.
Tested with German, Japanese and Arabic. Works for me apart from the is_rosetta_site()
bit, it seems my global $rosetta
is null.
Co-authored-by: Adam Wood <[email protected]>
This enables the stylesheet to be loaded on a local environment by switching the test site's locale. See #380 (comment)
This enables the stylesheet to be loaded on a local environment by switching the test site's locale. See WordPress/wporg-main-2022#380 (comment)
Hyphenation was added to fix https://meta.trac.wordpress.org/ticket/7398, but we have a better way of handling resizing fonts for rosetta sites now, see #380 Fixes #442
This adds a place for polyglots teams to add page & section-specific overrides for their sites. Anything more global should go in the parent theme, see the related PR: WordPress/wporg-parent-2021#120.
Specifically in this PR, I've added some code to shrink the headings on the About page, as they're defined in the CSS, not theme.json settings.
See #266, WordPress/wporg-parent-2021#120.
Screenshots
How to test the changes in this Pull Request:
You can test localized sites by following the instructions on wporg-main-2022.
I also tested this on my sandbox with the top completed languages for wporg.