WordPress / wporg-theme-directory

15 stars 6 forks source link

Tools: Add RTLCSS step to theme build process #53

Closed ryelle closed 3 months ago

ryelle commented 3 months ago

This PR adds RTLCSS to the webpack build process (which requires a custom webpack.config.js, but we can inherit most of the configuration). This also fixes an issue with ratings on RTL sites.

Fixes #47, See https://github.com/WordPress/wporg-main-2022/issues/124

Screenshots

Before After
Screenshot 2024-05-01 at 4 21 29 PM Screenshot 2024-05-09 at 2 55 55 PM

How to test the changes in this Pull Request:

  1. Update the packages with yarn
  2. Run yarn build:theme
  3. You should see -rtl.css files in the build output & build folder
  4. View a single theme on an RTL site (using a sandbox)
  5. The rating bar and stars should be appropriately RTL too
ryelle commented 3 months ago

Note that I added a PR to wp-scripts to add RTLCSS there. I'm still going to merge this since I don't know how quickly that would make it through, but maybe we'll be able to remove it in a few weeks 🤞🏻