Skip to content

Commit

Permalink
[TASK] Force accessible focus styles
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Jul 12, 2023
1 parent bcb93af commit bd11190
Show file tree
Hide file tree
Showing 10 changed files with 233 additions and 78 deletions.
128 changes: 92 additions & 36 deletions Resources/Public/Css/bootstrap5-rte.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Resources/Public/Css/bootstrap5-rte.min.css

Large diffs are not rendered by default.

128 changes: 92 additions & 36 deletions Resources/Public/Css/bootstrap5-theme.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Resources/Public/Css/bootstrap5-theme.min.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Resources/Public/Scss/bootstrap5/compat/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ fieldset.form-group {
input[type="password"] {
@extend .form-control;
}
input[type="submit"] {
margin-top: 1rem;
@extend .btn;
@extend .btn-primary;
}
}
2 changes: 2 additions & 0 deletions Resources/Public/Scss/bootstrap5/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
//
// Components
//
@import "../components/form";
@import "../components/button";
@import "../components/navbar";
@import "../components/nav";
@import "../components/backendlayout";
@import "../components/section";
@import "../components/frame";
Expand Down
17 changes: 17 additions & 0 deletions Resources/Public/Scss/components/_accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,20 @@ $accordion-content-gap: $spacer !default;
}
}
}

//
// Accessible focus styles
//
.accordion-button {
--#{$prefix}accordion-btn-focus-ring-contrast-color: #ffffff;
--#{$prefix}accordion-btn-focus-ring-color: #000000;
}
.accordion-button:focus-visible {
z-index: 3;
border-color: var(--#{$prefix}accordion-btn-focus-border-color);
outline: 0;
box-shadow: var(--#{$prefix}accordion-btn-focus-box-shadow);
--bs-accordion-btn-focus-box-shadow:
0 0 0 2px var(--#{$prefix}accordion-btn-focus-ring-contrast-color),
0 0 0 4px var(--#{$prefix}accordion-btn-focus-ring-color);
}
14 changes: 14 additions & 0 deletions Resources/Public/Scss/components/_form.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Accessible focus styles
//
.form-check-input:focus-visible,
.form-select:focus-visible,
.form-control:focus-visible {
--#{$prefix}input-focus-ring-contrast-color: #ffffff;
--#{$prefix}input-focus-ring-color: #000000;
outline: 0;
box-shadow:
$input-focus-box-shadow,
0 0 0 2px var(--#{$prefix}input-focus-ring-contrast-color),
0 0 0 4px var(--#{$prefix}input-focus-ring-color);
}
9 changes: 9 additions & 0 deletions Resources/Public/Scss/components/_nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// Navs
//
.nav-link {
&:focus-visible {
outline: 2px solid;
box-shadow: none;
}
}
4 changes: 0 additions & 4 deletions Resources/Public/Scss/components/navbar/_link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
align-items: center;
gap: .25em;
border-radius: 2px;
&:focus-visible {
outline: 2px solid;
box-shadow: none;
}
}
.nav-link-icon {
flex-grow: 0;
Expand Down

0 comments on commit bd11190

Please sign in to comment.