ben-rogerson / twin.macro

🦹‍♂️ Twin blends the magic of Tailwind with the flexibility of css-in-js (emotion, styled-components, solid-styled-components, stitches and goober) at build time.
MIT License
7.89k stars 184 forks source link

Add support for tailwind config files in ESM/TS format + Update prettier #794

Closed albohlabs closed 1 year ago

albohlabs commented 1 year ago

This is my naive implementation of tailwind config ESM/TS support.

I dropped import-fresh package because it has an outstanding issue for adding support for ES Modules. The config is loaded via loadConfig which is provided by tailwind. The prettier update was introduced because of the satisfies operator, which is supported since Prettier v2.8. See prettier/prettier#13516

@ben-rogerson pls jump in and help me out to finalize the PR.

As a reaction of https://github.com/ben-rogerson/twin.macro/discussions/792#discussioncomment-5501351

ben-rogerson commented 1 year ago

Great work, just had to add an auto loader for .ts files and adjust the tests slightly - thanks heaps for your work here