Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carousel navigation focus #1242

Merged
merged 10 commits into from Jun 1, 2022
Merged
27 changes: 25 additions & 2 deletions scss/_carousel.scss
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 {
julien-deramond marked this conversation as resolved.
Show resolved Hide resolved
&[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 {
louismaximepiton marked this conversation as resolved.
Show resolved Hide resolved
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
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
julien-deramond marked this conversation as resolved.
Show resolved Hide resolved
) !default;

$border-style: solid !default;
Expand Down
1 change: 1 addition & 0 deletions site/content/docs/5.1/utilities/borders.md
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