-
Notifications
You must be signed in to change notification settings - Fork 673
UnderlineNav: Improve flickering by moving icon visibility control to a one-way CSS animation
#8108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a789e19
302d679
6fac497
a10a95c
a1f49a5
5076e18
8965e7c
f755913
15d64eb
b79ae2e
5614068
6b360c1
2c8e848
c9c8c00
b3e85f5
aa035a8
91f39db
fc168b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@primer/react": patch | ||
| --- | ||
|
|
||
| `UnderlineNav`: Fix icon flickering on some screen sizes before initial render/hydration |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,18 +18,14 @@ | |
| padding-inline: unset; | ||
| } | ||
|
|
||
| &[data-hide-icons='true'] [data-component='icon'] { | ||
| display: none; | ||
| } | ||
|
|
||
| &[data-overflow-mode='wrap'] { | ||
| /* Wrap items onto hidden next lines */ | ||
| overflow: hidden; | ||
| max-height: var(--control-xlarge-size); | ||
|
|
||
| .UnderlineItemList { | ||
| flex-wrap: wrap; | ||
| overflow: hidden; | ||
| flex: 1; | ||
|
Comment on lines
-32
to
+28
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, this can't be arbitrarily small;
0.0001msis treated as0in Chrome.0.1msseems to work very consistently though.I did try making the duration dynamic, instead of the play state, and setting the duration to
0to immediately resolve the animation when I want to toggle it. That didn't work though; the style didn't 'stick' if the duration was increased again.