scaffold child-theme: add RTL stylesheet support via wp_style_add_data()#372
Merged
swissspidy merged 5 commits intomainfrom Mar 4, 2026
Merged
scaffold child-theme: add RTL stylesheet support via wp_style_add_data()#372swissspidy merged 5 commits intomainfrom
scaffold child-theme: add RTL stylesheet support via wp_style_add_data()#372swissspidy merged 5 commits intomainfrom
Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add loading for rtl.css in child-theme scaffold
scaffold child-theme: add RTL stylesheet support via wp_style_add_data()
Mar 4, 2026
swissspidy
reviewed
Mar 4, 2026
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
swissspidy
approved these changes
Mar 4, 2026
scaffold child-theme: add RTL stylesheet support via wp_style_add_data()
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the wp scaffold child-theme output so generated child themes declare RTL support for their enqueued stylesheet via wp_style_add_data(), and adds a Behat assertion to ensure the generated functions.php includes that RTL metadata.
Changes:
- Add
wp_style_add_data( $child_handle, 'rtl', 'replace' )to the child themefunctions.phptemplate. - Extend the scaffold Behat feature to assert the RTL metadata call is present in generated
functions.php.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| templates/child_theme_functions.mustache | Adds RTL metadata for the child theme stylesheet handle. |
| features/scaffold.feature | Adds an acceptance assertion for the new RTL metadata line in generated functions.php. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
swissspidy
reviewed
Mar 4, 2026
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.
wp scaffold child-themeenqueued parent and child stylesheets but never registered RTL variants, leaving RTL language sites without proper stylesheet direction switching.Changes
templates/child_theme_functions.mustache: Addwp_style_add_data( $handle, 'rtl', 'replace' )after the child theme'swp_enqueue_style()call so WordPress automatically loads the-rtl.cssvariant when text direction is RTL. The parent theme's style is not given RTL data since its structure is unknown.Generated
functions.phpnow looks like:features/scaffold.feature: Assert thewp_style_add_datacall is present for the child theme style in the generatedfunctions.php.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.