From 963d635621c0a466c2f6d5e3d65f601185975201 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 15 May 2026 11:10:35 +0000 Subject: perf(transitions): narrow the universal * selector Replace the * { transition: color/bg/border/shadow } rule with a :where() list of the surfaces that actually receive state changes (anchors, buttons, form controls, cards, details/summary, role=button, role=menuitem, role=option). Every element no longer pays the transition (especially box-shadow, the costly one) on theme switch or parent re-paint. --- src/styles/colours.css | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/styles/colours.css b/src/styles/colours.css index eadd0c91..0442fee4 100644 --- a/src/styles/colours.css +++ b/src/styles/colours.css @@ -42,7 +42,19 @@ } } -* { +:where( + a, + button, + input, + select, + textarea, + details, + summary, + .card, + [role="button"], + [role="menuitem"], + [role="option"] +) { transition: color var(--duration-fast) var(--ease-in-out-quart), background-color var(--duration-fast) var(--ease-in-out-quart), -- cgit v1.2.3