Raw .home / .post source selectors collide with WordPress body and post classes

Đang mở
#6,930 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

Chưa có ai nhận issue này.

Đá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
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php, wordpress
Lĩnh vực
frontend

Hướng nghiên cứu

Start in ArtifactCompiler/WordPressCompatCss.php around line 288 and trace how navigation replay emits source class selectors. Then find the handling in SourceClassIdentity::needsMarker and check how it applies to raw .home and .post selectors. Add or update focused tests for navigation replay and post-like classes; done means both selector types use the source-class marker without affecting unrelated WordPress classes.

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

Mô tả

Found importing https://javisantana.com/ (a ~750-page static blog) with WordPress Studio CLI 2.2.0 and the Data Liberation Agent / Static Site Importer / Blocks Engine releases current on 2026-11-19, before blocks-engine#6890, #6909, #6912 and #6914 merged.

Problem (latent; no visible difference on this site)

SourceClassIdentity::needsMarker renames source classes that WordPress also puts on <body> (home, page, single, …). Two places still emit raw source selectors that collide:

  1. Navigation style replay (ArtifactCompiler/WordPressCompatCss.php, around line 288) emits raw .home selectors. For example:

    • :root :where(.home .wp-block-navigation .wp-block-navigation-item__content){color:inherit;text-decoration:none}
    • .home footer .wp-block-navigation …{color:var(--muted)}

    On the front page <body> has class home, so these rules also restyle navigation blocks in header and footer template parts, not just the source <main class="home">.

  2. .post selectors stay raw (for example .post{max-width:var(--measure);margin:auto}). post isn't a body class, but post_class() adds it to every Query Loop item, so any archive or listing template would pick these rules up.

Evidence

On the imported homepage, removing every body class that matches a source selector changed no element's computed style or geometry at 390 and 1440px. That's only because this site has no navigation outside <main>.

Expected

The navigation replay and post-like classes go through the same source-class marker as other colliding classes.

🤖 Generated with Claude Code

Ngôn ngữ chính
PHP
Star
31
Fork
7
Merge trung bình
3 giờ 40 phút
Pull request đã merge (30 ngày)
813

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.