vercel/styled-jsx

Resolve urls inside separate css-files

Open

#598 aperta il 8 nov 2019

Vedi su GitHub
 (6 commenti) (2 reazioni) (0 assegnatari)JavaScript (310 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (7547 star)
Metriche merge PR
 (Merge medio 25g 23h) (1 PR mergiata in 30 g)

Descrizione

Do you want to request a feature or report a bug?

Request a feature or request docs addition

Images in url() do not resolve if separate css-files setup is used.

https://github.com/zeit/styled-jsx#styles-in-regular-css-files Here it is documented how to use separate files for styles. However if we do that we can no longer insert images resolved by Webpack.

I tried to use css-loader but then the styles are rendered in such a way that it won't work at all.

Are there any plans or ideas how to handle this properly? Css inside components doesn't seem right but images have to be handled with Webpack. Normally there are some means to parse them out of url(). Without Webpack I can't use image loaders like those that encode images in base64. Without separate files I can't use IDE css helping tools. Something is off.

I ended up rolling my own Webpack loader to handle this but it seems like too much complexity.

Guida contributor