Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Prioritize Critical CSS strips leading / from asset urls #2092

Open
azt3k opened this issue Jul 5, 2022 · 1 comment
Open

Prioritize Critical CSS strips leading / from asset urls #2092

azt3k opened this issue Jul 5, 2022 · 1 comment

Comments

@azt3k
Copy link

azt3k commented Jul 5, 2022

I have font face references in my css that look like this after optimisation:

@font-face{font-family:helvetica-black;font-weight:400;font-style:normal;src:url(/resources/font/helvetica-black/5ba229ac-ba95-456c-9c0d-9e10cc8de8d6.eot);src:url(/resources/font/helvetica-black/5ba229ac-ba95-456c-9c0d-9e10cc8de8d6.eot?#iefix) format("eot") , url(/resources/font/helvetica-black/8ede94c2-af21-4381-92e8-e40c05f98715.woff2) format("woff2") , url(/resources/font/helvetica-black/4550aa51-8a1d-40f2-a8c3-13384b0bb1e2.woff) format("woff") , url(/resources/font/helvetica-black/e9b5da31-e566-4f36-a41f-31b1101a16b5.ttf) format("truetype")}

These are fine in the optimised css file, however when critical css is prioritised it removes the leading / from the urls which breaks them on sub pages:

@font-face{font-family:helvetica-black;font-weight:400;font-style:normal;src:url(resources/font/helvetica-black/5ba229ac-ba95-456c-9c0d-9e10cc8de8d6.eot);src:url(resources/font/helvetica-black/5ba229ac-ba95-456c-9c0d-9e10cc8de8d6.eot?#iefix) format("eot") , url(resources/font/helvetica-black/8ede94c2-af21-4381-92e8-e40c05f98715.woff2) format("woff2") , url(resources/font/helvetica-black/4550aa51-8a1d-40f2-a8c3-13384b0bb1e2.woff) format("woff") , url(resources/font/helvetica-black/e9b5da31-e566-4f36-a41f-31b1101a16b5.ttf) format("truetype")}

trim urls is not enabled

@Lofesa
Copy link
Contributor

Lofesa commented Jul 6, 2022

Have you tried to put absolutes url's?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants