mitosis icon indicating copy to clipboard operation
mitosis copied to clipboard

SolidJS: migrate `css` prop solution to solid-styled

Open samijaber opened this issue 2 years ago • 5 comments

Migrate our approach for the css prop in the SolidJS generator from using https://github.com/solidjs/solid-styled-components to using https://github.com/lxsmnsyc/solid-styled (as recommended by some folks in the SolidJS Community)

samijaber avatar Dec 07 '22 21:12 samijaber

Hey @samijaber, I would like to contribute to this. I found this line , is responsible for importing the css wrapper from solid-styled-components, which needs to change to make the migration happen and we are injecting css into the component here using the style tag, does the css string also needs to be changed for it to work?

(Sorry for the newbie questions, just needed a heads up if this is the correct approach)

akshatgarg12 avatar Dec 11 '22 12:12 akshatgarg12

@akshatgarg12 I haven't had time to look: I am not familiar with the difference between both, so we'd need to read up the docs/API of both and see if there are differences between them, and go from there.

I actually also see that solid-styled requires Babel https://github.com/lxsmnsyc/solid-styled#babel, which would be an extra thing to setup for the SolidJS output to work properly. That does make me wonder if we should commit to it, although it sounds like this is the direction the SolidJS community is exploring...

samijaber avatar Dec 19 '22 20:12 samijaber

Note to anyone who'll look into this. If possible, make the solution work on Solid components class="" rather than className="", because className quite likely could go away in future versions. Setups like clsx might come in handy.

birkskyum avatar Oct 12 '23 17:10 birkskyum