Skip to content

Commit

Permalink
fix(controls): Avoid showing focus styles for disabled controls (#1365)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstoffan authored Apr 27, 2021
1 parent da2702f commit f8e8b8b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib/viewers/controls/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ $bp-controls-size-small: 32px;
$bp-controls-spacing: 6px;

@mixin bp-Control($height: $bp-controls-size-default, $width: $bp-controls-size-default) {
@include bp-Control--fade;
@include bp-Control--outline;

display: flex;
align-items: center;
justify-content: center;
Expand Down Expand Up @@ -39,9 +42,6 @@ $bp-controls-spacing: 6px;
padding: 5px;
border-radius: $bp-controls-radius-inner;
}

@include bp-Control--fade;
@include bp-Control--outline;
}

@mixin bp-Control--expand {
Expand All @@ -54,20 +54,20 @@ $bp-controls-spacing: 6px;
transition: opacity 150ms;
will-change: opacity; // Prevent flickering in Safari

&:focus,
&:hover {
&:focus:not(:disabled),
&:hover:not(:disabled) {
opacity: 1;
}
}

@mixin bp-Control--outline {
outline: 0;

&:focus {
&:focus:not(:disabled) {
box-shadow: $bp-controls-outline; // Show effect for all events in legacy browsers (IE, Safari)
}

&:focus-visible {
&:focus-visible:not(:disabled) {
box-shadow: $bp-controls-outline; // Show effect for keyboard events in modern browsers
}

Expand Down

0 comments on commit f8e8b8b

Please sign in to comment.