Skip to content

Commit

Permalink
feat(carousel): new navigation focus style (#1242)
Browse files Browse the repository at this point in the history
  • Loading branch information
MewenLeHo authored Jun 1, 2022
1 parent 726df16 commit b3db327
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
27 changes: 25 additions & 2 deletions scss/_carousel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
text-align: center;
background: none;
border: 0;
outline: 0; // Boosted mod
opacity: $carousel-control-opacity;
@include transition($carousel-control-transition);

Expand All @@ -124,9 +125,19 @@
}

&:active {
--#{$boosted-prefix}control-bg: #{$carousel-control-icon-active-bg}; // Boosted mod
--#{$boosted-prefix}control-bg: #{$carousel-control-icon-active-bg};
color: $carousel-control-color;
}

&:focus {
&[data-focus-visible-added] {
& > span {
outline: map-get($border-widths, 3) solid $brand-orange;
outline-offset: $outline-offset;
box-shadow: 0 0 0 $outline-offset $white;
}
}
}
// End mod
}

Expand Down Expand Up @@ -208,12 +219,24 @@
&:hover,
&:focus {
background-color: color-contrast($carousel-indicator-active-bg);
transform: scale($carousel-indicator-hover-scale);
}

&:hover {
transform: scale($carousel-indicator-hover-scale);
&::before {
transform: translate3d(-50%, -50%, 0) scale($carousel-indicator-active-scale);
}
}

&:focus {
&[data-focus-visible-added] {
outline: map-get($border-widths, 3) solid $brand-orange;
outline-offset: $outline-offset;
box-shadow: 0 0 0 $outline-offset $white;
transform: none;
}
}

}

.active {
Expand Down
3 changes: 2 additions & 1 deletion scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@ $container-padding-x: $grid-gutter-width !default;
$border-width: .125rem !default;
$border-widths: (
1: $border-width * .5,
2: $border-width
2: $border-width,
3: $border-width * 1.5
) !default;

$border-style: solid !default;
Expand Down
1 change: 1 addition & 0 deletions site/content/docs/5.1/utilities/borders.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Or, choose from any of the `.border-opacity` utilities:
<span class="border border-0"></span>
<span class="border border-1"></span>
<span class="border border-2"></span>
<span class="border border-3"></span>
{{< /example >}}

## Radius
Expand Down

0 comments on commit b3db327

Please sign in to comment.