Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* **node:** Create a Webpack config for compiling docs using Fractal.
* **css:** Updated stylelint ruleset to match Bedrock's linting pattern. (#814)
* **js** Updated `addListener` method, which is now deprecated, to be replaced by `addEventListener`. `addListener` will be used as a fallback for older browsers.
* **css** Updated focus states for buttons. (#864)

## Bug Fixes
* **js:** Ensure focus is moved to modal after animation completes (#829)
Expand Down
19 changes: 8 additions & 11 deletions assets/sass/protocol/components/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
@mixin default-states {
&:focus {
border-color: $button-border-color-focus;
box-shadow: $field-focus-ring;
outline: $field-focus-ring-outline;
outline-offset: 1px;
}

&:hover {
Expand All @@ -28,7 +29,9 @@
@mixin default-states-dark {
&:focus {
border-color: $button-border-color-focus;
box-shadow: $field-focus-ring-dark;
box-shadow: $field-focus-ring-white;
outline: $field-focus-ring-outline;
outline-offset: 1px;
}

&:hover {
Expand All @@ -47,8 +50,9 @@

@mixin product-states {
&:focus {
border-color: $button-border-color-focus;
box-shadow: $field-focus-ring;
border-color: $button-border-color-focus-product;
outline: $field-focus-ring-outline;
outline-offset: 1px;
}

&:hover {
Expand Down Expand Up @@ -87,13 +91,6 @@ a.mzp-c-button {
padding: 6px $spacing-lg;
text-decoration: none !important; /* stylelint-disable-line declaration-no-important */

&:focus {
border-color: $button-border-color-focus;
box-shadow: $field-focus-ring;
color: $color-white;
outline: none;
}

&::-moz-focus-inner {
border: 0;
}
Expand Down
5 changes: 4 additions & 1 deletion assets/sass/protocol/includes/forms/_lib.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ $field-h-spacing: $spacing-md;
$field-v-spacing: $spacing-lg;
$field-focus-ring: 0 0 0 2px rgba($color-blue-40, 0.5);
$field-focus-ring-dark: 0 0 0 2px color.mix($color-blue-40, $color-white);
$field-focus-ring-white: 0 0 0 2px $color-white;
$field-focus-ring-outline: 2px solid color.scale($color-blue-50, $saturation: -15%, $lightness: 70%);
$field-focus-ring-error: 0 0 0 2px rgba($color-red-50, 0.5);

// buttons
$button-border-color-focus: #008aea;
$button-border-color-focus: $color-blue-50;
$button-border-color-focus-product: $color-blue-40;

// label
$label-v-spacing: $spacing-sm;
Expand Down