Skip to content

Commit

Permalink
wip variable stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
NickColley committed May 7, 2019
1 parent a4c3b95 commit 89f8132
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/helpers/_focusable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@
$_padding-bottom: 0;
}

$_box-shadow-spread: ($_padding-top + $_padding-bottom) / 2;
$_box-shadow-offset-y: $_box-shadow-spread - $_padding-top;

// When colours are overridden, for example when users have a dark mode,
// backgrounds and box-shadows disappear, so we need to ensure there's a
// transparent outline which will be set to a visible colour.
Expand Down Expand Up @@ -85,6 +82,11 @@
// sass-lint:enable indentation
}
} @else {
$_highlight-spread: ($_padding-top + $_padding-bottom) / 2;
$_highlight-offset-y: $_highlight-spread - $_padding-top;
$_highlight-padding-left-right: ($_padding-left-right - $_highlight-spread);
$_border-offset-y: ($_padding-bottom + $_border-width);

// When colours are overridden, for example when users have a dark mode,
// backgrounds and box-shadows disappear, so we need to ensure there's a
// transparent outline which will be set to a visible colour.
Expand All @@ -94,10 +96,10 @@
// Default if or it's inline-block or block
// box-shadow
// sass-lint:disable indentation
box-shadow: -($_padding-left-right - $_box-shadow-spread) $_box-shadow-offset-y 0 ($_box-shadow-spread) $govuk-focus-colour,
($_padding-left-right - $_box-shadow-spread) $_box-shadow-offset-y 0 ($_box-shadow-spread) $govuk-focus-colour,
-$_padding-left-right ($_padding-bottom + $_border-width) $_border-color,
$_padding-left-right ($_padding-bottom + $_border-width) $_border-color;
box-shadow: -$_highlight-padding-left-right $_highlight-offset-y 0 $_highlight-spread $govuk-focus-colour,
$_highlight-padding-left-right $_highlight-offset-y 0 $_highlight-spread $govuk-focus-colour,
-$_padding-left-right $_border-offset-y $_border-color,
$_padding-left-right $_border-offset-y $_border-color;
// sass-lint:disable indentation
}
}
Expand Down

0 comments on commit 89f8132

Please sign in to comment.