-
Notifications
You must be signed in to change notification settings - Fork 64
Update the VSearchTypeButton to match the new homepage designs #2069
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/_preview/2069 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
Size Change: -100 B (0%) Total Size: 896 kB
ℹ️ View Unchanged
|
173b094
to
7e8b808
Compare
The chevron rotation is mostly for indicating areas that expand/collapse. Like Gutenberg does. But in this case, the chevron lives in a button that opens a popover. Like Github does. Therefore, I would keep the chevron orientation as in the mockup. |
6fe9e98
to
805c716
Compare
1d1ce19
to
fd4f474
Compare
a037637
to
346287e
Compare
346287e
to
11fa9e7
Compare
06818c1
to
c9b691c
Compare
a2865a3
to
9e21abe
Compare
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.
It looks excellent ✨
I tested it with VoiceOver and the label was read correctly. Although I noticed one style error:
- The "showLabel = true" variant needs to have right padding of
12px
instead of8px
.
9e21abe
to
5373263
Compare
5f63b65
to
2e9f60e
Compare
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.
Looks good and works very well.
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.
Really great; lgtm.
20409db
to
25a5942
Compare
498c7dd
to
5106f6c
Compare
@@ -317,7 +317,7 @@ a.button { | |||
} | |||
|
|||
.action-menu { | |||
@apply border-tx bg-tx text-dark-charcoal hover:border-dark-charcoal-20; | |||
@apply border-tx bg-white text-dark-charcoal hover:border-dark-charcoal-20 group-focus-within:hover:border-tx; |
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.
@apply border-tx bg-white text-dark-charcoal hover:border-dark-charcoal-20 group-focus-within:hover:border-tx; | |
@apply border-tx bg-white text-dark-charcoal hover:border-dark-charcoal-20; |
Fixes
Related to #1433 by @panchovm
Description
The main goal of this PR is to make it possible to set whether the search type button has a label in JavaScript, instead of relying on the CSS breakpoint. This is necessary because the breakpoints from which the button has a text label (in addition to the icon) are different:
lg
on the homepage andxl
in the header.Here is a list of all changes in this PR:
to stop the button from changing the width when the label text changes, it adds all of the non-selected search type labels, but makes them invisible (and aria-hidden). This way, the button width is as high as the longest search type name. It is also capped at 175px (if the text is wider, it is truncated) to make sure that the button doesn't grow larger than 260px (the width of the content switcher popover).This change was reverted because it doesn't work well when the labels have very different lengths:activeType
in theuseSearchType
composable.rotates the chevron when the button is pressed to show that it's open. I wanted to try this out because that's what I usually see happen to the dropdown arrow, but I can easily revert it.Should it be rotated as in this PR, or should it stay the same as in Figma, @panchovm? - change reverted, see the reason in a comment below.Testing Instructions
Run the storybook to see the
VSearchTypeButton
.Go to
/preferences
and turn thenew_header
flag on. Then, check the VSearchTypeButton in the homepage searchbar, and in the search header. It should look correct, and should have correct aria properties (so, check the Screen reader experience, too).Checklist
Update index.md
).main
) ora parent feature branch.
errors.
Developer Certificate of Origin
Developer Certificate of Origin