diff --git a/tests/test_site_css.py b/tests/test_site_css.py index 66ffaf87d..8ed0b5e72 100644 --- a/tests/test_site_css.py +++ b/tests/test_site_css.py @@ -183,8 +183,11 @@ class ThemeStylesheet(unittest.TestCase): def test_card_pages(self): cards = next(b for s, b in _blocks(self.css) if s == ".sl-markdown-content :is(.rb-sys-file, .rb-file-entry)") - self.assertIn("content-visibility: auto", cards) - self.assertIn("contain-intrinsic-size: auto 320px", cards) + # A card off screen with content-visibility kept a placeholder + # height, and the links of the card above were drawn over its own + # (Lighthouse target-size, 31 links on the PS2 page, desktop). + self.assertNotIn("content-visibility", cards) + self.assertNotRegex(self.css, r"content-visibility\s*:") self.assertIn("--sl-content-width: var(--rb-grid-width)", _rules(self.css, "body:has(.rb-sys-file, .rb-file-entry)")[0]) self.assertEqual(_theme_tokens(self.css, ":root")["--rb-grid-width"], "54rem") facts = _rules(self.css, "dl.rb-facts")[0] diff --git a/website/src/styles/retrobios.css b/website/src/styles/retrobios.css index af292c40a..6a7435329 100644 --- a/website/src/styles/retrobios.css +++ b/website/src/styles/retrobios.css @@ -451,15 +451,16 @@ border-top: 1px solid var(--rb-border); } -/* File cards on system and emulator pages. A page holds hundreds: those - off screen are laid out when they come near, and the column is wide - enough for a sha256 on one line. */ +/* File cards on system and emulator pages. The column is wide enough for a + sha256 on one line. Every card is laid out: with content-visibility an + off-screen card took a 320px placeholder, the links of the card above it + were drawn over its own, and Lighthouse failed target-size on the PS2 + page (31 links on desktop, 7 on mobile). A page is split at about 280 cards, and laying them all out + moved no Lighthouse metric (PS2 page, mobile: TBT 0 ms both ways). */ body:has(.rb-sys-file, .rb-file-entry) { --sl-content-width: var(--rb-grid-width); } .sl-markdown-content :is(.rb-sys-file, .rb-file-entry) { border-top: 1px solid var(--rb-border); padding: 0.75rem 0 0.25rem; - content-visibility: auto; - contain-intrinsic-size: auto 320px; } .sl-markdown-content :is(.rb-sys-file, .rb-file-entry) > :first-child { margin-top: 0; } .sl-markdown-content .rb-file-title {