Skip to content

Commit

Permalink
Merge pull request #408 from danskernesdigitalebibliotek/DDFLSBP-55-b…
Browse files Browse the repository at this point in the history
…utton-focus

Added explicit focus  styles for buttons
  • Loading branch information
JacobArrow authored Dec 27, 2023
2 parents 1d83fe3 + e2b1075 commit 60d0cc8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/stories/Library/Buttons/button/buttons.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
$color__btn-border-active: $color__text-primary-black;
$color__btn-border-disabled: $color__global-tertiary-2;
$color__btn-filled-hover: $color__text-secondary-gray;

.btn-icon {
margin-left: $s-md;
Expand All @@ -25,12 +26,18 @@ $color__btn-border-disabled: $color__global-tertiary-2;

@include typography($typo__button);

&:hover {
&:hover,
&:focus-visible {
.btn-collapsible {
display: block;
}
}

&:focus-visible {
outline: 2px solid $color__btn-border-active;
box-shadow: inset 0 0 0 3px $color__text-primary-white;
}

&[disabled] {
border: 1px solid $color__btn-border-disabled;
color: $color__btn-border-disabled;
Expand Down Expand Up @@ -76,16 +83,19 @@ $color__btn-border-disabled: $color__global-tertiary-2;
background-color: $color__text-primary-black;
color: $color__text-primary-white;

&:hover {
opacity: 0.7;
&:hover,
&:focus-visible {
background-color: $color__btn-filled-hover;
border-color: $color__btn-filled-hover;
}
}

.btn-outline {
background-color: transparent;
color: $color__text-primary-black;

&:not([disabled]):hover {
&:not([disabled]):hover,
&:not([disabled]):focus-visible {
background-color: $color__text-primary-black;
color: $color__text-primary-white;
}
Expand Down

0 comments on commit 60d0cc8

Please sign in to comment.