Next.js Discord

Discord Forum

Tailwind url

Answered
Spectacled Caiman posted this in #help-forum
Open in Discord
Spectacled CaimanOP
If i have an svg in /public called test.svg, how can I reference this in a component somewhere in my app directory? I'm trying after:content-[url('../public/test.svg')] but it's not able to get the svg. I'm not sure where the url starts searching from
Answered by joulev
after:content-[url('/test.svg')]
View full answer

4 Replies

Oriental chestnut gall wasp
In my experience, .svg files are a little tricky to work with.
Are you using a webpack loader for .svgs like svgr?
Answer
@joulev after:content-[url('/test.svg')]
Spectacled CaimanOP
worked, thanks!