Skip to content
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

Background url asset #172

Closed
HBCharles opened this issue Jul 22, 2017 · 3 comments
Closed

Background url asset #172

HBCharles opened this issue Jul 22, 2017 · 3 comments

Comments

@HBCharles
Copy link

I'm moving all my css code to emotion. The background url doesn't find my assets in the public folder. Is there any configuration to make it working ?

@dkozickis
Copy link

@HBCharles did you figure it out?

@dkozickis
Copy link

Turns out it's a basic thing :)

import showPass from 'ic-show-pass.svg';

and then

 background: url(${props => (props.type === 'password') ? showPass : hidePass}) no-repeat;

or whatever you were doing

@Khrystyna
Copy link

What worked for me was:

import icon from './icon.svg';
...
background: `url(${icon})`,
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants