Cannot reference images from staticDirectories
in custom.css
#6208
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
closed: working as intended
This issue is intended behavior, there's no need to take any action.
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
The
css
file defined intheme.customCss
tries to reference an image fromstaticDirectories
, but it cannot find it.Steps to reproduce
Setup new config:
baseUrl
- e.g.myProject
staticDirectories
- e.g.path.resolve(__dirname, '../img')
img/myImg.png
theme.customCss
insidepresets
->classic
- e.g.custom.css
http://localhost:3000/myProject/myImg.png
existscustom.css
, reference/myProject/myImg.png
content: url(/myProject/myImg.png);
content: url(myImg.png);
-> None of these work.
Expected behavior
I understand why this errors out. I don't necessarily expect it to work.
But I would expect to somehow be able to reference images using a non-relative path.
Actual behavior
It complains that it cannot find the image:
Your environment
2.0.0-beta.13
Reproducible demo
No response
Self-service
The text was updated successfully, but these errors were encountered: