ItsJonQ / g2

✨ An experimental reimagining of WordPress components
http://g2-components.com/
MIT License
105 stars 12 forks source link

Create Styles: Update rtlcss to the latest v3 for PostCSS v8 #246

Closed ItsJonQ closed 3 years ago

ItsJonQ commented 3 years ago
Screen Shot 2021-01-22 at 11 08 20 AM

The easiest way to test would be to go into the rtl.js plugin and adjust the return condition to force RTL processing:

function stylisRTLPlugin(context, content) {
    if (context === STYLIS_PROPERTY_CONTEXT) {
        // pass four undefineds to let TS know which overload we're using
        return true
            ? rtlcss.process(content, undefined, undefined, undefined)
            : undefined;
    }
    return undefined;
}

Resolves https://github.com/ItsJonQ/g2/issues/245

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/itsjonq/g2/aqo00qzt7
✅ Preview: https://g2-git-update-rtlcss-v3.itsjonq.vercel.app

gziolo commented 3 years ago

I wanted to check if there is a way to switch locale in Storybook instead. I see there is an addon that would be useful for testing: https://github.com/goooseman/storybook-addon-i18n

I haven't tested but I guess you can merge it based on the screenshot shared 👍🏻

ItsJonQ commented 3 years ago

@gziolo Thank you!! I do want to figure out how to improve the testing of RTL. And if possible (gasp) make it dynamic.