Open jantimon opened 4 months ago
probably we could go a step further:
import { styled } from "next-yak";
const Button = styled.button`...`
could be compiled to (at least for all currently known tags)
import { _styled_button } from "next-yak/internal";
const Button = _styled_button`...`
This would:
c.button
becomes just n
)
Right now in
next-yak
, we useProxy
to provide the same API like styled components.It lets devs write code like
styled.div
to style any html element tag or even custom elements.Unfortunately according to https://romgrk.com/posts/optimizing-javascript proxies prevent compiler optimization and therefore might slow down our runtime during SSR and hydration.
As
next-yak
compiles the code anyway we can change the components fromstyled.div`...
tostyled("div", ...)
.