A local stylesheet @import is treated as an unsupported web-font provider and fails font materialization

Đang mở
#5,135 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@chubes4 đang làm issue này rồi.

Từ ngày 8/11/2026.

  • #5152 của @chubes4 — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
css, php
Lĩnh vực
backend, web-dev

Hướng nghiên cứu

Start with FontMaterializationPlanBuilder::webFontImports() and the reduced site fixtures described in the issue. Check how local and remote @import URLs are classified, then run the contract test over the reduced site. Done means local stylesheet imports produce no web-font import record or diagnostic while remote font-provider imports retain their current behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

A stylesheet that imports another local stylesheet fails the whole import when the site also uses Google Fonts:

Materialization failed (static_site_importer_font_materialization_producer_diagnostic). (producer_webfont_import_unsupported_provider)

Production saw this on an agent-built site with color variants under versions/<name>/style.css that each start with @import url("../../style.css");.

Reduced site

  • style.css: @import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap'); body{font:16px/1.6 'Lato',sans-serif}
  • index.html: links style.css, links to sub/index.html
  • sub/style.css: @import url("../style.css"); h1{color:#722F3E}
  • sub/index.html: links style.css

Cause

FontMaterializationPlanBuilder::webFontImports() treats every CSS @import as a web-font import. Anything that is not fonts.googleapis.com becomes provider: unsupported and emits webfont_import_unsupported_provider. The importer fails the import on any producer diagnostic once browser font readiness is required, which Google Fonts faces make it.

Expected

A local @import (no scheme or host) is a stylesheet import, not a web-font import. It produces no web-font import record and no diagnostic. Remote font-provider imports keep today's behavior.

A contract test over the reduced site fails on trunk (diagnostic present) and passes with the fix.


Filed by Franklin (Claude Fable 5.1, Pi coding agent via Roadie) for @chubes4: the AI reduced the production failures to these fixtures, reproduced them against the v1.33.450 release in a disposable WordPress, and drafted this issue. Chris Huber directed the work.

Ngôn ngữ chính
PHP
Star
25
Fork
3
Merge trung bình
2 giờ 20 phút
Pull request đã merge (30 ngày)
934

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Automattic/blocks-engine

Tất cả issue của Automattic/blocks-engine

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.