Skip to content
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

Add Menu button in new header variant #3478

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

SriHV
Copy link
Contributor

@SriHV SriHV commented Jan 22, 2025

What is the context of this PR?

ONSDESYS-159
Added Menu button in the new header variant "basic". The Menu will have Top section and new Lower section
Topic section will have up to 3 columns. Each column have a header and under it can contain hyperlinks
Lower section will have also have 3 columns and subsequent child items.
The spacing for now is similar to the items in footer component.

Introduced new button variant for the menu button and also followed tech notes left in the ticket

The example is taken from here

Code is similar to the one available here

How to review this PR

Check that example-header-basic has the new menu button and has the design as specified in figma and the prototype

Checklist

This needs to be completed by the person raising the PR.

  • I have selected the correct Assignee
  • I have linked the correct Issue

Copy link

netlify bot commented Jan 22, 2025

Deploy Preview for ons-design-system-preview ready!

Name Link
🔨 Latest commit 10f6b7d
🔍 Latest deploy log https://app.netlify.com/sites/ons-design-system-preview/deploys/679b91cb04d1a10008628290
😎 Deploy Preview https://deploy-preview-3478--ons-design-system-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@SriHV SriHV changed the title Enhancement/159/add menu button in new header variant Add Menu button in new header variant Jan 22, 2025
@SriHV SriHV self-assigned this Jan 22, 2025
@SriHV SriHV added the Enhancement Change of existing feature label Jan 22, 2025
@SriHV SriHV requested a review from a team January 23, 2025 15:52
@SriHV SriHV marked this pull request as ready for review January 23, 2025 15:52
@rmccar
Copy link
Contributor

rmccar commented Jan 24, 2025

Screenshot 2025-01-24 at 11 43 29

Im not sure if the focus state should look like this, usually our focus states have black underlines. This will need to be checked with a designer

@rmccar
Copy link
Contributor

rmccar commented Jan 24, 2025

Screenshot 2025-01-24 at 11 43 52

The links in the menu look like this when focused

@rmccar
Copy link
Contributor

rmccar commented Jan 24, 2025

Screenshot 2025-01-24 at 11 52 41

When open and focused on, the menu button looks like this, I know its like this in the prototype but I think this may need to be reviewed by a designer

@SriHV
Copy link
Contributor Author

SriHV commented Jan 29, 2025

After talking to Joe, I've added border to the menu when hovered, focus or active

@SriHV
Copy link
Contributor Author

SriHV commented Jan 29, 2025

Screenshot 2025-01-24 at 11 43 52 The links in the menu look like this when focused

This is fixed now

@rmccar
Copy link
Contributor

rmccar commented Jan 30, 2025

Screenshot 2025-01-30 at 09 02 45

Is Joe happy with when the menu is open that on the menu button there is no difference when hovering or focusing?

@SriHV
Copy link
Contributor Author

SriHV commented Jan 30, 2025

Screenshot 2025-01-30 at 09 02 45 Is Joe happy with when the menu is open that on the menu button there is no difference when hovering or focusing?

Yes, he told to match the color of the text. So for hover and active it is --ons-color-text-link-hover and for focus it is --ons-color-black

@rmccar
Copy link
Contributor

rmccar commented Jan 30, 2025

Screenshot 2025-01-30 at 09 02 45 Is Joe happy with when the menu is open that on the menu button there is no difference when hovering or focusing?

Yes, he told to match the color of the text. So for hover and active it is --ons-color-text-link-hover and for focus it is --ons-color-black

When the menu is open the text colour doesn't look like its changing when its hovered or focused to me

@SriHV
Copy link
Contributor Author

SriHV commented Jan 30, 2025

Screenshot 2025-01-30 at 09 02 45 Is Joe happy with when the menu is open that on the menu button there is no difference when hovering or focusing?

Yes, he told to match the color of the text. So for hover and active it is --ons-color-text-link-hover and for focus it is --ons-color-black

When the menu is open the text colour doesn't look like its changing when its hovered or focused to me

I spoke with Joe, we don’t need the color change—the hover and focus states for the menu button is similar to gov.uk.

Copy link
Contributor

@rmccar rmccar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the params need to be reorganised a bit more. I find the structure of them and the names a bit confusing and dont represent what they actually are to the user. Ive made some suggestions which you dont have to go with if you can think of a better way of structuring it but have a think about it

&--menu {
align-items: center;
display: flex;
height: 67px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should avoid setting the height like this. Find out how the height is set on the header and see if you can inherit that

Comment on lines +573 to +574
border: 0;
border-radius: 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these?

border-radius: 0;
box-shadow: none;
color: var(--ons-color-text-link);
font-weight: 700;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already being set with the ons-u-fs-s--b class


&--menu:focus & {
&__inner {
background: none;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesnt need to be set

Comment on lines +247 to +248
margin-bottom: 1rem;
padding-top: 2.5rem;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can extend utility classes here

| button | object`<SignOutButton>` | false | Settings for the [sign out button](#signoutbutton) in the header used to exit a transactional service |
| navigation | array`<Navigation>` | false | Settings for the [main menu links](#navigation) |
| siteSearchAutosuggest | `Autosuggest` [_(ref)_](/components/autosuggest) | false | Sets the autosuggest functionality in the header |
| navLinks | object`<ServiceLinks>` | false | Settings for the [menu button navigation](#navLinks) in the masthead |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think nav links is quite close to navigation, we need to differentiate between them because they are different things. Also the object that gets passed in needs to match the name of the object in the documentation (ServiceLinks isn't the object)

| classes | string | false | Classes to add to the `<nav>` element |
| ariaLabel | string | false | The `aria-label` attribute added to the `<nav>` element. Defaults to “Menu links navigation”. |
| ariaListLabel | string | false | The `aria-label` attribute added to the `<ul>` element. Defaults to “Menu links”. |
| keyLinksList | array`<Item>` | true | Settings for an array of [key list items](#keyitem) for each navigation link |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this should just be keyLinks

| ariaLabel | string | false | The `aria-label` attribute added to the `<nav>` element. Defaults to “Menu links navigation”. |
| ariaListLabel | string | false | The `aria-label` attribute added to the `<ul>` element. Defaults to “Menu links”. |
| keyLinksList | array`<Item>` | true | Settings for an array of [key list items](#keyitem) for each navigation link |
| itemsList | array`<Item>` | true | Settings for an array of [list items](#item) for each navigation link |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldnt this be linksList? But I actually think this isn't descriptive enough. Maybe it should be
menuLinks > menuGroup > Items I think thats a bit more descriptive to the user what that is referring to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Change of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants