eBay / skin

Pure CSS framework designed & developed by eBay for a branded, e-commerce marketplace.
https://ebay.github.io/skin/
MIT License
178 stars 67 forks source link

Refactor code to use CSS Logical Properties #1885

Closed ianmcburnie closed 11 months ago

ianmcburnie commented 1 year ago

With our recent browser policy update, I believe we can start leveraging CSS Logical Properties. This will allow us to do away with the current approach of using [dir=rtl] selector.

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties

Example of current code that can be refactored: https://github.com/eBay/skin/blob/master/src/less/button/button.less#L460

As a side note, it's probably going to take a little while getting used to these!!!

tigt commented 1 year ago

Even if we can’t make the full change yet, we should definitely update the [dir=rtl] attribute selector to instead use the dedicated :dir() pseudo-class, for more robust behavior when nesting dir changes.

ianmcburnie commented 1 year ago

Even if we can’t make the full change yet, we should definitely update the [dir=rtl] attribute selector to instead use the dedicated :dir() pseudo-class, for more robust behavior when nesting dir changes.

Browser compatibility doesn't look so hot: https://developer.mozilla.org/en-US/docs/Web/CSS/:dir#browser_compatibility

tigt commented 1 year ago

Ah, damn. I must have confused its browser support with :lang()’s instead.