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
28 changes: 26 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;
julien-deramond marked this conversation as resolved.
Show resolved Hide resolved
opacity: $carousel-control-opacity;
@include transition($carousel-control-transition);

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

&: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:focus-visible,
julien-deramond marked this conversation as resolved.
Show resolved Hide resolved
&: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 +220,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
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
julien-deramond marked this conversation as resolved.
Show resolved Hide resolved
) !default;

$border-style: solid !default;
Expand Down