davesnx / styled-ppx

Type-safe styled components for ReScript, Melange and native with type-safe CSS
https://styled-ppx.vercel.app
BSD 2-Clause "Simplified" License
399 stars 32 forks source link

Generate the CSS runtime (styled-ppx.css) from Parser.re #426

Open davesnx opened 5 months ago

davesnx commented 5 months ago

With the mechanism of value.rec ppx. It should be doable to generate all the interface to render CSS. Right now value.rec generates the functions to parse CSS into an AST, and it generates the Types as well. We could add another pass to render the AST into strings.

The generated code might look like similar to bs-css, but would be nice to have a few improvements over them:

Possible step by step