support for converting css logical properties
- Dominant language
- Go
- Stars
- 40.1k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
CSS Logical Properties aren't rewritten for older browsers:
A working postcss plugin is available here:
https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical
Essentially:
````css
.element {
block-size: 100px;
max-inline-size: 400px;
inline-size: 200px;
padding-block: 10px 20px;
margin-inline: auto;
border-block-width: 2px;
border-block-style: solid;
}
/* becomes */
.element {
height: 100px;
max-width: 400px;
width: 200px;
padding-top: 10px;
padding-bottom: 20px;
margin-left: auto;
margin-right: auto;
border-top-width: 2px;
border-bottom-width: 2px;
border-top-style: solid;
border-bottom-style: solid;
}
````
I'm current targeting Chrome 84. Chrome 87 supports the newer syntax. eg: https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline
Try link:
https://esbuild.github.io/try/#YgAwLjE4LjE1AC0tYnVuZGxlIGVudHJ5LmpzIC0tb3V0ZmlsZT1vdXQuanMgLS10YXJnZXQ9Y2hyb21lODQAZQBlbnRyeS5qcwBpbXBvcnQgc3R5bGVzIGZyb20gJy4vc3R5bGVzLmNzcyc7AABzdHlsZXMuY3NzAC5sb2dpY2FsIHsKICBibG9jay1zaXplOiAxMDBweDsKICBtYXgtaW5saW5lLXNpemU6IDQwMHB4OwogIGlubGluZS1zaXplOiAyMDBweDsKICBwYWRkaW5nLWJsb2NrOiAxMHB4IDIwcHg7CiAgbWFyZ2luLWlubGluZTogYXV0bzsKICBib3JkZXItYmxvY2std2lkdGg6IDJweDsKICBib3JkZXItYmxvY2stc3R5bGU6IHNvbGlkOwp9CgoucmV3cml0ZS10ZXN0IHsKICBtYXNrLWltYWdlOiBub25lOwp9Cgo
Contributor guide
No contributing guide indexed for this repository
Research direction
Use the linked postcss-logical plugin and the provided esbuild Try link as behavioral references. Confirm that the listed logical properties are converted to the physical-property output for Chrome 84 targets, and verify the result with focused CSS transform coverage before considering the work done.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, go
- Domain
- compilers, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100