You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This one was actually brought up by @manassehkatz and we dismissed it at first, believing it to be due to GitHub Pages not rendering SVGs for security concerns, but that turned out to be incorrect.
I wasn't aware that relative url() paths in CSS are relative to the CSS asset itself and not to the document in which it is included[1]. As such, the straightforward solution - demonstrated in terms of processed ("compiled") CSS would actually be:
url("../img/hero-bg.svg")
However, it's been a little painful getting that to work on the SCSS / Webpack setup.
and installing/setting up svg-url-loader, but this is not a proper solution as it encodes the svg to data:image/svg+xml and that's not what we would expect.
(Update: Requested guidance from DevOps leader JustinM.)
This one was actually brought up by @manassehkatz and we dismissed it at first, believing it to be due to GitHub Pages not rendering SVGs for security concerns, but that turned out to be incorrect.
Consider the staging deployment at https://codidact.github.io/landing-page/.
How it should look:

How it looks:

The background SVG asset https://codidact.github.io/assets/img/hero-bg.svg does not load. Notice anything?
The zen among us will notice the missing subdirectory string (
landing-page/
) in the resource path.The culprit is
landing-page/src/styles/sections/hero.scss
Line 2 in 7c2670d
Since the code is "compiled" to
url(/assets/img/hero-bg.svg)
1, one possible solution would be:url("../../assets/img/hero-bg.svg")
...but I'm not sure how robust that is for every case.
-
1: shame how the style guidelines aren't kept after SCSS compilation (the double quotes) :|
The text was updated successfully, but these errors were encountered: