astroturfcss / astroturf

Better Styling through Compiling: CSS-in-JS for those that want it all.
https://astroturfcss.github.io/astroturf/
MIT License
2.28k stars 60 forks source link

API Proposal #718

Closed jsg2021 closed 2 years ago

jsg2021 commented 3 years ago

@jquense How open to a PR that exposed a static method on the returned component that would allow you to pass props in and get the className/style props that would be applied?

I have a use case where my team would like to compose some base-level components but would prefer to consolidate them in the render tree as one node.

So, for example, let's say we have a Padding component, a Typography component, and a Button component, ... the button composes Padding and Typography and as of now it would show in dev tools as three nodes if the button could call on a method to combine all the class names/styles we could get Button to be the only node in the graph.