aesthetic-suite / framework

🎨 Aesthetic is an end-to-end multi-platform styling framework that offers a strict design system, robust atomic CSS-in-JS engine, a structural style sheet specification (SSS), a low-runtime solution, and much more!
https://aestheticsuite.dev
MIT License
203 stars 5 forks source link

How do you access the react props from the styler function? #12

Closed cuevash closed 6 years ago

cuevash commented 7 years ago

Typically in a code like:

style((theme) => ({ button: { fontSize: ${theme.unitSize}${theme.unit}, fontFamily: theme.font, padding: theme.spacing, }, }))(Component);

you has access to the theme object, but how can you access the props object that is passed to the HoC ?

Cheers!

milesj commented 7 years ago

Hey @cuevash,

The React props are not passed to the style function, only the theme and any parent styles. What use case do you have for needing the props?

milesj commented 6 years ago

@cuevash

This is now possible with 2.0. https://github.com/milesj/aesthetic#style-functions