refactor: hold the search hint in one attribute

Two empty kbd elements with a data-key each added 24 bytes to every
page and put RomM over its weight budget in test_site_platform_density.
The hint is one data-key on the outer kbd, 50 bytes lighter than the
text it replaced.
This commit is contained in:
Abdessamad Derraz committed 2026-11-19 18:42:55 +01:00
1 parent 9760c2fadd
commit b2ec1969e0
2 files changed
+8 -7

No files matched your search

+1 -1
View File
@@ -1019,7 +1019,7 @@ class SearchButtonShowsOnlyItsName(unittest.TestCase):
text = re.sub(r"<[^>]*>", "", button[button.index(">", button.index("aria-keyshortcuts")) + 1:])
self.assertEqual(text.split(), ["{Astro.locals.t('search.label')}"])
self.assertIn("kbd[data-key]::before", search)
self.assertIn("platformKey.dataset.key = '⌘';", search)
self.assertIn("shortcut.dataset.key = '⌘ K';", search)
class LogosAtTheirWeight(unittest.TestCase):