Skip to content

Commit

Permalink
Add a new applied variable for focus text colour
Browse files Browse the repository at this point in the history
  • Loading branch information
NickColley committed Sep 7, 2018
1 parent de1c426 commit 16a6272
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/details/_details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
outline-offset: -1px;
// When focussed, the text colour needs to be darker to ensure that colour
// contrast is still acceptable
color: $govuk-text-colour;
color: $govuk-focus-text-colour;
background: $govuk-focus-colour;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/error-summary/_error-summary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
// When focussed, the text colour needs to be darker to ensure that colour
// contrast is still acceptable
&:focus {
color: $govuk-text-colour;
color: $govuk-focus-text-colour;
}

// alphagov/govuk_template includes a specific a:link:focus selector
Expand Down
5 changes: 3 additions & 2 deletions src/components/footer/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
color: $govuk-footer-link-hover;
}

// Use text colour when focussed
// When focussed, the text colour needs to be darker to ensure that colour
// contrast is still acceptable
&:focus {
color: $govuk-text-colour;
color: $govuk-focus-text-colour;
}

// alphagov/govuk_template includes a specific a:link:focus selector
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
// When focussed, the text colour needs to be darker to ensure that colour
// contrast is still acceptable
&:focus {
color: $govuk-text-colour;
color: $govuk-focus-text-colour;
}

// alphagov/govuk_template includes a specific a:link:focus selector
Expand Down Expand Up @@ -245,7 +245,7 @@
// When focussed, the text colour needs to be darker to ensure that colour
// contrast is still acceptable
&:focus {
color: $govuk-text-colour;
color: $govuk-focus-text-colour;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
// When focussed, the text colour needs to be darker to ensure that colour
// contrast is still acceptable
&:focus {
color: $govuk-text-colour;
color: $govuk-focus-text-colour;
}
}

Expand Down Expand Up @@ -79,7 +79,7 @@
// When focussed, the text colour needs to be darker to ensure that colour
// contrast is still acceptable
&:focus {
color: $govuk-text-colour;
color: $govuk-focus-text-colour;
}

// alphagov/govuk_template includes a specific a:link:focus selector designed
Expand Down
10 changes: 10 additions & 0 deletions src/settings/_colours-applied.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ $govuk-secondary-text-colour: govuk-colour("grey-1") !default;

$govuk-focus-colour: govuk-colour("yellow") !default;

/// Focused text colour
///
/// Ensure that the contrast between the text and background colour passes
/// WCAG Level AA contrast requirements.
///
/// @type Colour
/// @access public

$govuk-focus-text-colour: govuk-colour("black") !default;

/// Error colour
///
/// Used to highlight error messages and form controls in an error state
Expand Down

0 comments on commit 16a6272

Please sign in to comment.