Skip to content

fix(html): rewrite CSS url() references to use hashed filenames#3046

Open
jhult wants to merge 2 commits intorust-lang:masterfrom
jhult:fix/css-url-rewriting
Open

fix(html): rewrite CSS url() references to use hashed filenames#3046
jhult wants to merge 2 commits intorust-lang:masterfrom
jhult:fix/css-url-rewriting

Conversation

@jhult
Copy link
Contributor

@jhult jhult commented Mar 3, 2026

Fixes #2958

When font files are hashed for cache-busting, CSS url() references were not updated to use the hashed filenames, causing custom fonts to fail loading.

This fix rewrites url() references in CSS files during write_files, handling all three quoting styles (url("…"), url('…'), url(…)), resolving paths relative to the CSS file's location before looking up in the hash map, and leaving absolute/data URLs untouched.

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local custom font files are serialized since version 0.5 - how to reference them?

2 participants