prevwong / craft.js

🚀 A React Framework for building extensible drag and drop page editors
https://craft.js.org
MIT License
7.5k stars 723 forks source link

Please support Emotion OR StyledComponent #419

Open jlrosenberg opened 2 years ago

jlrosenberg commented 2 years ago

Is your feature request related to a problem? Please describe. By forcing the inclusion of styled-component as a dependency, this is increasing the transpiled bundle size of people using other styling frameworks.

Describe the solution you'd like Nowadays, there are many 'jss' like frameworks - the two biggest being styled-components and emotion. MUI supports both of these by allowing you to set the framework via a StyleProvider component that wraps the app. This allows people to use the framework that they already have in their codebase, reducing the number of dependencies and size of the transpiled js bundle. Since the emotion api is a superset of the styled component one, it should hopefully be not too bad to support both of them.

Also, please move StyledComponent from devDependencies to dependencies in @craftjs/layers package, it is currently incorrect and breaking builds.

Additional context Add any other context or screenshots about the feature request here.

pavi2410 commented 2 years ago

I second this. I use mantine.dev and it uses Emotion. So having styled-components is kind of a burden for me.