How do you use a relative path as a CSS url() parameter if my file is in a NextJS public folder?
Unanswered
Transvaal lion posted this in #help-forum
Transvaal lionOP
I want to use an SVG located in the
My usage of this relative path looks like:
Not sure what I'm doing wrong.
public directory. How do I access it?My usage of this relative path looks like:
mask: url("/public/HeroVectorsSVG.svg") radial-gradient(var(--pulse-vectors) var(--pulse-vectors) at 50% 50%, #D9D9D9 0%, rgba(217, 217, 217, 0.00) 100%);Not sure what I'm doing wrong.
4 Replies
think of public's contents as root so just
/HeroVectorsSVG.svg (if that file is in public folder)@riský think of public's contents as root so just `/HeroVectorsSVG.svg` (if that file is in public folder)
Transvaal lionOP
That goes for any file located within the public folder, right? It can be accessed the same way from an SCSS file or TSX file.
yeah
ie if
/public/a/b/c.txt then you access at /a/b/c.txt