Repository navigation
fix: Reduce size of icon hover-motion CSS - #5156
Open
TrevorBurnham wants to merge 1 commit into
Open
TrevorBurnham wants to merge 1 commit into
TrevorBurnham wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5156 +/- ##
==========================================
- Coverage 97.72% 93.88% -3.85%
==========================================
Files 995 994 -1
Lines 32129 27830 -4299
Branches 11851 9576 -2275
==========================================
- Hits 31399 26127 -5272
- Misses 684 784 +100
- Partials 46 919 +873 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
TrevorBurnham
force-pushed
the
icon-hover-motion-css-size
branch
from
October 27, 2026 20:47
3df62ae to
8fb64ab
Compare
This branch was previously 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.
Description
Icon hover-motion CSS, emitted when the One theme is included, is ~300 KB raw per copy of the library. Most of that is selector text: every hover rule repeats a long prefix (theme gate, trigger, disabled guard, target) once per trigger state, and there are four states since #5161.
This PR makes two output-only changes to
src/icon/hover-motion.scss::is([data-awsui-motion-trigger~=hover]:is(:hover, :focus-visible), [data-awsui-motion-trigger~=focus]:focus-visible, [data-awsui-motion-trigger~=delegated-focus]:focus-within:where(...)):not(:disabled):not([aria-disabled=true]). Each arm has the same specificity as the separate selectors it replaces, so the cascade is unchanged. No:has()is reintroduced..icon:is(.name-a, .name-b). An icon has a single name class, so merging across icons cannot change the cascade.lib/components/icon/styles.scoped.csswithINCLUDE_ONE_THEME=true:Builds without the One theme are unaffected (no motion CSS is emitted).
Related links, issue #, if available: n/a
How has this been tested?
main: every other CSS file underlib/componentsis byte-identical.main.prefers-reduced-motionsettings. All 693,120 property comparisons matched.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.