You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling the useStyling hook is verbose, especially for small components, e.g.:
import{useStyling}from'glaze';exportdefaultfunctionComponent(){constsx=useStyling();return(<pclassName={sx({px: 4,// Sets padding-left and padding-right to 1remcolor: 'white',bg: 'red',// Sets background to #f8485e})}>
Hello, world!
</p>);}
Basic example
Instead, an API like below could be made possible with code transforms:
exportdefaultfunctionComponent(){return(<psx={{px: 4,// Sets padding-left and padding-right to 1remcolor: 'white',bg: 'red',// Sets background to #f8485e}}>
Hello, world!
</p>);}
Details
Style composition (#4) should also be made available.
A custom JSX pragma is not required, nor recommended. If someone opts into using the Babel plugin, TypeScript module augmentation should be applied on React elements, extending the list of available props with sx.
The text was updated successfully, but these errors were encountered:
For auto-importing the useStyling hook, the implementation in emotion-js/emotion#200 can be utilized. After that, every component with an element using the sx prop should start with:
Motivation
Calling the
useStyling
hook is verbose, especially for small components, e.g.:Basic example
Instead, an API like below could be made possible with code transforms:
Details
Style composition (#4) should also be made available.
A custom JSX pragma is not required, nor recommended. If someone opts into using the Babel plugin, TypeScript module augmentation should be applied on React elements, extending the list of available props with
sx
.The text was updated successfully, but these errors were encountered: