ItsJonQ / g2

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

RTL: Check document.dir on css() execution rather than using a cached value #272

Closed ItsJonQ closed 3 years ago

ItsJonQ commented 3 years ago

Using document.dir instead of document.getAttribute('dir') for rtl checking https://developer.mozilla.org/en-US/docs/Web/API/Document/dir

I didn't know about this 😍 It's also much faster (tested with https://jsbench.me/)

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

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/Fs5UXqaoR7Q26Fv9iavAvmbjJhjh
✅ Preview: https://g2-git-update-styles-rtl-check-itsjonq.vercel.app