-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly resolve url(...)
in style strings
#182
Labels
Comments
satya164
added
bug 🐛
Issue is a confirmed bug
good first issue 😊
It is a good issue for new comers
labels
Nov 30, 2017
I think we can calculate the correct path without stylis |
@zamotany how? the |
But with this: const logo = css`
background: url(${require(../assets/bat.png)});
`; we can calculate the correct path. Tho you're right, the solution with stylis will work for both cases |
It's interesting! Do you want me to give this a hand? 🙌 |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's broken
Say you have the following file structure:
Now you write following in
App.js
:This won't work, because the generated CSS file will be at
.linaria-cache/src/components/App.css
, and when resolving../assets/bat.png
, webpack will look relative to the the generated file.How to fix
We can write a
stylis
plugin which replaces relative paths inurl
with the correct path relative to the generated file.The text was updated successfully, but these errors were encountered: