Skip to content

Commit 5976c47

Browse files
committed
Fix style and accessibility issues
1 parent 880a6aa commit 5976c47

17 files changed

Lines changed: 92 additions & 49 deletions

File tree

assets/css/main.css

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/sass/colors/_functional.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $aplus-success: #00803c; // There should be a contrast ratio above 4.5 between t
77
$aplus-info: #1d7792; // This is a darkened version of the bootstrap 3 default. Contrast must be >=4.5 with white.
88
$aplus-warning: #a6670e; // This is a darkened version of the bootstrap 3 default. Contrast must be >=4.5 with white.
99
$aplus-danger: #a50000; // There should be a contrast ratio above 7 between this and white.
10-
$aplus-focus: #ffdd00; // This should be clearly different fron those defned above and the brand colours.
10+
$aplus-focus: #ffdd00; // This should be clearly different from those defined above and the brand colours.
1111

1212
// These colours may be used to represent the status of the grading.
1313
$aplus-primary-status-bg: #42a5f5;

assets/sass/components/_button.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,7 @@ $large-height: 24px;
123123
}
124124
}
125125
}
126+
127+
.aplus-submit {
128+
@include button-basics;
129+
}

assets/sass/components/_focus.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
@import '../mixins/focus';
22

33
// These styles apply consistent focus states to elements which
4-
// don't have a focus state defined elswhere, including inside the
4+
// don't have a focus state defined elsewhere, including inside the
55
// course content.
66

77
// It's preferable to use component-specific focus styles where
88
// possible, and they should be mixed into all new components.
99

10-
a:focus-visible,
11-
input:focus-visible,
12-
textarea:focus-visible,
13-
select:focus-visible,
10+
a:focus-visible:not(.dropdown-item),
11+
input:focus-visible:not(.form-control, .aplus-submit, [class^="aplus-button"]),
12+
textarea:focus-visible:not(.form-control),
13+
select:focus-visible:not(.form-select),
1414
div:focus-visible {
1515
@include focus-with-outline-only;
1616
}

assets/sass/components/_pagination.scss

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
nav.row.siblings {
22
flex-direction: row;
33
justify-content: space-between;
4-
margin: 0 5px;
54

6-
a.nav-flex-left, a.nav-flex-right {
7-
white-space: nowrap;
8-
max-width: 45%;
9-
overflow: hidden;
10-
text-overflow: ellipsis;
11-
width: auto;
12-
}
5+
a.d-inline-flex {
6+
max-width: 100%; // Constrain the link to not overflow its container
7+
8+
> span.nav-flex-left,
9+
> span.nav-flex-middle,
10+
> span.nav-flex-right {
11+
overflow: hidden;
12+
text-overflow: ellipsis;
13+
white-space: nowrap;
14+
}
15+
}
1316

1417
&::before,
1518
&::after {

assets/sass/layout/_header.scss

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,18 @@ article {
3737
.navbar-nav > li > a,
3838
.navbar-nav > .active > a,
3939
.navbar-nav > .active > a:hover {
40-
@include focus-with-background-and-color;
40+
@include focus-with-outline-only;
4141
text-decoration: none;
4242
color: #ffffff;
4343
background: transparent;
4444
}
4545

46+
.navbar-toggler {
47+
&:focus {
48+
box-shadow: 0 0 0 0.25rem $aplus-focus;
49+
}
50+
}
51+
4652
.navbar-brand, .navbar-dropdown > li.dropdown > a.dropdown-toggle {
4753
padding-top: $navbar-padding-vertical;
4854
padding-bottom: $navbar-padding-vertical;
@@ -62,15 +68,15 @@ article {
6268
.navbar-nav > .open > a,
6369
.navbar-nav > .open > a:focus,
6470
.navbar-nav > .open > a:hover {
65-
@include focus-with-background-and-color;
71+
@include focus-with-outline-only;
6672
background-color: #236aa7;
6773
background-color: rgba(0, 0, 0, 0.1);
6874
}
6975
.navbar-nav > li.active > a:focus,
7076
.navbar-nav > li.open > a:focus {
7177
&:focus,
7278
&:hover {
73-
@include focus-with-background-and-color;
79+
@include focus-with-outline-only;
7480
background-color: rgba(0,0,0,0.1);
7581
}
7682
}
@@ -94,7 +100,6 @@ article {
94100
min-width: 0;
95101

96102
.navbar-dropdown {
97-
flex: 1 1 start;
98103
min-width: 0;
99104

100105
li.dropdown {

assets/sass/legacy/_main.scss

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,24 @@ iframe {
132132
--bs-btn-active-border-color: transparent;
133133
}
134134

135+
.dropdown-item {
136+
@include focus-with-background-and-color;
137+
}
138+
139+
#courseDropdownMenu {
140+
overflow: hidden;
141+
overflow-y: auto;
142+
max-height: calc(100vh - 150px);
143+
144+
@media (max-width: 575.98px) {
145+
width: 75vw;
146+
147+
.dropdown-item {
148+
white-space: normal;
149+
}
150+
}
151+
}
152+
135153
/* Skip links */
136154

137155
.skip-link { /* This one is equally applicable to all skip links */
@@ -149,18 +167,18 @@ iframe {
149167
position: absolute;
150168
z-index: 2000;
151169
width: auto;
152-
min-height: 50px;
153-
height: auto;
170+
height: 46px;
154171
overflow: visible;
155172
clip: auto;
156-
padding: 15px;
173+
padding: 12px;
157174
display: flex;
158175
justify-content: left;
159176
}
160177

161178
.page-skip-link:focus {
162179
@include focus-with-background-and-color;
163-
min-height: 24px;
180+
min-height: 28px;
181+
height: auto;
164182
}
165183

166184
/* menus */
@@ -239,9 +257,12 @@ iframe {
239257
.toc li {
240258
list-style: none;
241259
}
242-
#course-content a{
260+
#course-content a:not(.dropdown-toggle) {
243261
@include focus-with-background-and-color;
244262
}
263+
#course-content a:has(.dropdown-toggle) {
264+
@include focus-with-outline-only;
265+
}
245266
@media (min-width: 768px) {
246267
#course-content {
247268
padding-left: 16vw;
@@ -255,8 +276,9 @@ iframe {
255276
}
256277

257278
/* panels */
258-
.module-panel {
259-
overflow: hidden;
279+
.table-responsive:has(.results-table) {
280+
border-bottom-left-radius: var(--bs-accordion-inner-border-radius);
281+
border-bottom-right-radius: var(--bs-accordion-inner-border-radius);
260282
}
261283
.module-panel .panel-heading {
262284
display: block;
@@ -289,6 +311,7 @@ iframe {
289311
#modulesAccordion .accordion-button {
290312
@include focus-with-background-and-color;
291313
background-color: var(--bs-primary);
314+
--bs-accordion-btn-focus-box-shadow: none;
292315
}
293316
#modulesAccordion .accordion-button::after {
294317
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");

assets/sass/main.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ $card-title-spacer-y: 0px;
6262
// Legacy panel look for BS5 cards
6363
//$card-bg: #f5f5f5;
6464

65+
$primary-border-subtle: $aplus-focus;
66+
$focus-ring-color: $aplus-focus;
67+
$input-focus-border-color: $aplus-focus;
68+
6569
@import 'vendor/bootstrap5';
6670

6771
// Import Bootstrap Icons (change font file directory from default)

assets/sass/mixins/_focus.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
@mixin focus-with-outline-only {
1111
&:focus-visible {
12-
outline: 3px solid $aplus-focus !important;
12+
box-shadow: 0 0 0 0.25rem $aplus-focus !important;
13+
outline: none !important;
1314
}
1415
}
1516

@@ -18,6 +19,7 @@
1819
background-color: $aplus-focus !important;
1920
color: $aplus-foreground !important;
2021
outline: 3px solid rgba(0, 0, 0, 0) !important;
22+
box-shadow: none !important;
2123
text-decoration: underline;
2224
}
2325
}

0 commit comments

Comments
 (0)