Conversation
…t page Each page's inline <style> CSS is parsed as its own source, so a block every page prints landed in the global sheet once per page. The later copies then outranked one page's own override at equal specificity. Keep the first copy, drop byte-identical repeats from later pages' inline sources, and renumber the survivors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Many sites print the same
<style>block into every page's head. A site import added one copy of those rules per page to the global sheet. The later copies then beat a page's own override at equal specificity, so that page's override lost.In a browser that page's link is near-black. After import, later pages' white copies land after the override, so it turns white.
The fix:
url()by page directory, so the same text in different folders stays distinct.This assumes a page prints the site-wide block before its own rules, as themes do. A page that prints its own rule before the site-wide block would now have that rule win, where a browser lets the site-wide block win. It does not help when a page overrides the exact same selector, since the importer merges those into one rule that no longer matches the site-wide copy.
Verification
bun run buildbun run lintbun test: 7058 pass, 0 failNew tests in
src/__tests__/siteImport/inlineRuleDedupe.test.tsfail onmainand pass with this change.Checklist
🤖 Generated with Claude Code