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

Improvements to inverse components #3925

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
}

.govuk-breadcrumbs--inverse {
color: govuk-colour("white");
color: $govuk-inverse-text-colour;

.govuk-breadcrumbs__link {
@include govuk-link-style-inverse;
Expand Down
18 changes: 16 additions & 2 deletions packages/govuk-frontend/src/govuk/components/button/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ $govuk-button-background-colour: govuk-colour("green") !default;

$govuk-button-text-colour: govuk-colour("white") !default;

/// Inverted button component background colour
///
/// @type Colour
/// @access public

$govuk-inverse-button-background-colour: $govuk-inverse-text-colour !default;

/// Inverted button component text colour
///
/// @type Colour
/// @access public

$govuk-inverse-button-text-colour: $govuk-brand-colour !default;

@include govuk-exports("govuk/component/button") {
$govuk-button-colour: $govuk-button-background-colour;
$govuk-button-text-colour: $govuk-button-text-colour;
Expand All @@ -35,8 +49,8 @@ $govuk-button-text-colour: govuk-colour("white") !default;
$govuk-warning-button-shadow-colour: govuk-shade($govuk-warning-button-colour, 60%);

// Inverse button variables
$govuk-inverse-button-colour: govuk-colour("white");
$govuk-inverse-button-text-colour: govuk-colour("blue");
$govuk-inverse-button-colour: $govuk-inverse-button-background-colour;
$govuk-inverse-button-text-colour: $govuk-inverse-button-text-colour;
$govuk-inverse-button-hover-colour: govuk-tint($govuk-inverse-button-text-colour, 90%);
$govuk-inverse-button-shadow-colour: govuk-shade($govuk-inverse-button-text-colour, 30%);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
margin: 0;
padding: 0;
border: 0;
color: govuk-colour("white");
color: $govuk-header-text;
background: none;
cursor: pointer;

Expand Down
4 changes: 2 additions & 2 deletions packages/govuk-frontend/src/govuk/helpers/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,14 @@
@mixin govuk-link-style-inverse {
&:link,
&:visited {
color: govuk-colour("white");
color: $govuk-inverse-text-colour;
}

// Force a colour change on hover to work around a bug in Safari
// https://bugs.webkit.org/show_bug.cgi?id=224483
&:hover,
&:active {
color: rgba(govuk-colour("white"), .99);
color: rgba($govuk-inverse-text-colour, .99);
}

&:focus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ $govuk-print-text-colour: #000000 !default;

$govuk-secondary-text-colour: govuk-colour("dark-grey") !default;

/// Inverse text colour
///
/// Used for text and links that appear on dark coloured backgrounds.
///
/// @type Colour
/// @access public

$govuk-inverse-text-colour: govuk-colour("white") !default;

/// Focus colour
///
/// Used for outline (and background, where appropriate) when interactive
Expand Down