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 orange outline on global site search #1752

Merged
merged 2 commits into from
Oct 27, 2020
Merged

Conversation

danacotoran
Copy link
Contributor

What

The global header was recently updated to use the search component instead of a hard coded search field.

This resulted in an issue where the input outline is now orange due to more specific styles from govuk_template conflicting with the search component styles.

This updates the component styles to be more specific in order to override the CSS from govuk_template.

Why

The site search input focus style has an orange outline due to govuk_template styles being more specific than the search component styles.
The outline should match the focus style of the search button.

Visual Changes

Before

Screenshot 2020-10-26 at 14 11 39

After

Screenshot 2020-10-26 at 14 58 44

NOTE: as of the time this PR is being created the bug is not live, we caught the issue on staging.

https://trello.com/c/RbD3om74

@bevanloon bevanloon temporarily deployed to govuk-publis-fix-header-acnq6d October 26, 2020 15:11 Inactive
@danacotoran danacotoran force-pushed the fix_header_input_focus branch from 3b453e9 to 222d515 Compare October 26, 2020 15:21
@bevanloon bevanloon temporarily deployed to govuk-publis-fix-header-acnq6d October 26, 2020 15:22 Inactive
alex-ju
alex-ju previously approved these changes Oct 26, 2020
Copy link
Contributor

@alex-ju alex-ju left a comment

Choose a reason for hiding this comment

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

as of the time this PR is being created the bug is not live, we caught the issue on staging

We seem to have it in production already 😬 not the orange, but the yellow one.

Screenshot 2020-10-26 at 15 51 06

.gem-c-search__input[type="search"] { // overly specific to prevent some overrides from outside
// stylelint-disable selector-max-id
.gem-c-search__input[type="search"],
#global-header .gem-c-search__input[type="search"] { // overly specific to prevent some overrides from outside
Copy link
Contributor

Choose a reason for hiding this comment

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

Awful we need this but until we get rid of govuk_template styles we don't have a real alternative.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes unfortunately we can't remove the conflicting styles from the govuk_template repo itself so till we get rid of that dependency, this will have to do 😬

@danacotoran danacotoran force-pushed the fix_header_input_focus branch from 222d515 to 48dacec Compare October 26, 2020 17:12
@bevanloon bevanloon temporarily deployed to govuk-publis-fix-header-acnq6d October 26, 2020 17:13 Inactive
@alex-ju alex-ju dismissed their stale review October 26, 2020 17:17

The approach has changed

@danacotoran danacotoran force-pushed the fix_header_input_focus branch from 48dacec to 69171a9 Compare October 27, 2020 10:54
@bevanloon bevanloon temporarily deployed to govuk-publis-fix-header-acnq6d October 27, 2020 10:54 Inactive
@danacotoran danacotoran force-pushed the fix_header_input_focus branch from 69171a9 to 5017abd Compare October 27, 2020 11:24
@bevanloon bevanloon temporarily deployed to govuk-publis-fix-header-acnq6d October 27, 2020 11:24 Inactive
The global header was recently updated to use the search component
instead of a hard coded search field.

This resulted in an issue where the input outline is now orange due to
more specific styles from govuk_template conflicting with the search
component styles.

This updates the component styles to be more specific in order to
override the CSS from govuk_template. It uses the compatibility mixin to
ensure the fix is only applied when in compatibility mode, and also to
ensure the code is easier to clean up when compatibility mode is no
longer a "thing".
@danacotoran danacotoran force-pushed the fix_header_input_focus branch from 5017abd to d58bafe Compare October 27, 2020 14:11
@bevanloon bevanloon temporarily deployed to govuk-publis-fix-header-acnq6d October 27, 2020 14:11 Inactive
@danacotoran danacotoran requested a review from injms October 27, 2020 14:33
Copy link
Contributor

@alex-ju alex-ju left a comment

Choose a reason for hiding this comment

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

Thank you for the review @36degrees, and for the work on this @danacotoran!

@danacotoran danacotoran merged commit 7058a30 into master Oct 27, 2020
@danacotoran danacotoran deleted the fix_header_input_focus branch October 27, 2020 14:44
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.

4 participants