Skip to content

Commit

Permalink
Fix orange outline on global site search
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
danacotoran committed Oct 27, 2020
1 parent 76fc9e4 commit bd9e48c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ $large-input-size: 50px;

.gem-c-search__input[type="search"] { // overly specific to prevent some overrides from outside
@include govuk-font($size: 19, $line-height: (28 / 19));

padding: 6px;
margin: 0;
width: 100%;
Expand Down Expand Up @@ -71,6 +70,13 @@ $large-input-size: 50px;
}
}

@include govuk-compatibility(govuk_template) {
// ultra specific rule overrides focus styling from govuk_template
#global-header .gem-c-search__input[type="search"]:focus { // stylelint-disable selector-max-id
@extend .gem-c-search__input[type="search"]:focus; // stylelint-disable scss/at-extend-no-missing-placeholder
}
}

.gem-c-search__submit {
border: 0;
cursor: pointer;
Expand Down

0 comments on commit bd9e48c

Please sign in to comment.