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

CSS src url changes relative paths to root #261

Open
mevanloon opened this issue Apr 14, 2024 · 4 comments
Open

CSS src url changes relative paths to root #261

mevanloon opened this issue Apr 14, 2024 · 4 comments

Comments

@mevanloon
Copy link

I have some font faces and image that are referenced relatively to the stylesheet, but those are all converted to "root" paths. So assets/fonts/coolfont.woff2 would become /assets/fonts/coolfont.woff2, which makes it not load.

@xenoborg
Copy link

My fonts work fine

@font-face {
font-family: alumni-sans;
src: url('fonts/Alumni_Sans/AlumniSans-VariableFont_wght.ttf');
}

but using the polyfill breaks any background image url or mask image url only in Firefox though, requiring a full web url to fix eg www.mywebsite.co.uk/folder/folder/i/test.png

.content__image {
width: 300px;
height: 300px;
clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
background-position: center;
background-image: url('i/test.png');
background-repeat: no-repeat;
background-color: black;
background-size: contain;
}

@weisJ
Copy link

weisJ commented Apr 23, 2024

I noticed this too. Background images are broken in Firefox (Linux only).

@weisJ
Copy link

weisJ commented Apr 24, 2024

This is due to the polyfill for non-inline styles putting the changed stylesheet into blob storage, which seems to have issues in firefox with relative urls. Seems like a non-css version would be very beneficial here. Or at least don't change stylesheets which don't need polyfilling.

@mevanloon
Copy link
Author

Indeed, it would be cool if there was a workaround where we could select what stylesheets to parse, or which ones to ignore. I experience this in webkit btw.

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