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

Fix header with product name focus and hover state length #2549

Merged
merged 1 commit into from
Feb 17, 2022

Conversation

owenatgov
Copy link
Contributor

@owenatgov owenatgov commented Feb 16, 2022

What

Changes the desktop display properly of the header homepage link from inline-block to inline.

Why

Addressing part of #2181

You can test this by starting a local review app, going to the header component and looking at the focus and hover states of "header with product name".

Visual changes

Focus state

Before:
Screenshot 2022-02-16 at 11 18 10

After:
Screenshot 2022-02-17 at 12 00 21

Hover state

Before:
Screenshot 2022-02-16 at 11 18 04

After:
Screenshot 2022-02-16 at 11 17 28

@owenatgov owenatgov requested a review from a team February 16, 2022 11:23
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2549 February 16, 2022 11:23 Inactive
@vanitabarrett
Copy link
Contributor

@owenatgov Nice work on picking this up 👍 In the 'after' screenshot, I can see the bottom of the GOV.UK text gets cut off a little bit (more noticeable on the 'G' and dot), which probably isn't ideal. I wonder if there's anything we can do to stop that?

@owenatgov
Copy link
Contributor Author

@vanitabarrett Good spot, how strange! It looks like this is coming from the box-shadow applied by the focus state. I'm just trying to work out why it's doing that; I don't really want to turn off a feature of our focus state.

@owenatgov owenatgov force-pushed the fix-header-with-product-name-click-area branch from a39df1c to 692c75c Compare February 16, 2022 11:59
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2549 February 16, 2022 11:59 Inactive
@owenatgov
Copy link
Contributor Author

@vanitabarrett I've found a solution that involved amending the box-shadow of the focus state. I'm not 100% comfortable with it but it's the best solution that didn't involve changing the height of the header, which I want to avoid. Let me know what you think.

@owenatgov owenatgov force-pushed the fix-header-with-product-name-click-area branch from 692c75c to 6366f9a Compare February 16, 2022 12:01
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2549 February 16, 2022 12:01 Inactive
@owenatgov owenatgov force-pushed the fix-header-with-product-name-click-area branch from 6366f9a to 5f6aa35 Compare February 16, 2022 12:01
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2549 February 16, 2022 12:02 Inactive
@vanitabarrett
Copy link
Contributor

Hm, I'm not 100% sure about this change. I think the change from inline-block to inline means that on super narrow screens things start getting cut off, whereas before they'd maintain the right size and overflow the container instead.

Example:

Before (234px wide)

Screenshot 2022-02-16 at 15 14 59

After (234px wide)

Screenshot 2022-02-16 at 15 15 04

Unfortunately I don't really have any other suggestions... I am wondering if this work would get any easier if we solved #1501, but maybe not.

@owenatgov
Copy link
Contributor Author

@vanitabarrett Bugger. I think you're right that the root of this is elsewhere. I'm pretty sure that issue is linked to this so I'll investigate if there's a way to solve both of these.

@owenatgov owenatgov force-pushed the fix-header-with-product-name-click-area branch from 5f6aa35 to f648d2d Compare February 17, 2022 09:40
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2549 February 17, 2022 09:40 Inactive
@owenatgov
Copy link
Contributor Author

@vanitabarrett After assessing this a bit more, I reckon #1502 is going to take a more thorough investigation. For now I've found a quick fix that solves the small screen problem by using a media query to control the display: inline change. Let me know what you think.

@vanitabarrett
Copy link
Contributor

@owenatgov Thanks for digging into it a bit! I agree, it might need a more thorough investigation. I quite like this quick fix, nice work 👍 I'm wondering if the box-shadow change should also be inside the media query, as we're essentially not changing the focus state at all in lower breakpoints?

@owenatgov owenatgov force-pushed the fix-header-with-product-name-click-area branch from f648d2d to e629503 Compare February 17, 2022 11:58
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2549 February 17, 2022 11:59 Inactive
@owenatgov
Copy link
Contributor Author

@vanitabarrett 100%. Applied!

Copy link
Contributor

@vanitabarrett vanitabarrett left a comment

Choose a reason for hiding this comment

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

As mentioned in Slack, this just needs a Changelog entry and then it should be ready to go

@vanitabarrett
Copy link
Contributor

@owenatgov Would you also mind adding the linked issue to the [next] milestone (indicating it will be release in the next version of GOV.UK Frontend)?

@owenatgov owenatgov force-pushed the fix-header-with-product-name-click-area branch from e629503 to 3e4cb11 Compare February 17, 2022 14:03
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2549 February 17, 2022 14:03 Inactive
@owenatgov owenatgov merged commit 48d1a52 into main Feb 17, 2022
@owenatgov owenatgov deleted the fix-header-with-product-name-click-area branch February 17, 2022 14:06
colinrotherham added a commit that referenced this pull request Nov 15, 2023
The link was given `display: inline` at tablet sizes but the product name doesn’t wrap until desktop: #2549
colinrotherham added a commit that referenced this pull request Nov 15, 2023
The link was given `display: inline` at tablet sizes but the product name doesn’t wrap until desktop: #2549
colinrotherham added a commit that referenced this pull request Nov 16, 2023
The link was given `display: inline` at tablet sizes but the product name doesn’t wrap until desktop: #2549
colinrotherham added a commit that referenced this pull request Nov 16, 2023
The link was given `display: inline` at tablet sizes but the product name doesn’t wrap until desktop: #2549
querkmachine pushed a commit that referenced this pull request Nov 20, 2023
The link was given `display: inline` at tablet sizes but the product name doesn’t wrap until desktop: #2549
querkmachine pushed a commit that referenced this pull request Nov 23, 2023
The link was given `display: inline` at tablet sizes but the product name doesn’t wrap until desktop: #2549
owenatgov pushed a commit that referenced this pull request Jan 11, 2024
The link was given `display: inline` at tablet sizes but the product name doesn’t wrap until desktop: #2549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants