Skip to content

Commit ca771d1

Browse files
authored
[ENG-2975][ENG-3043][ENG-3046][ENG-3049][ENG-3051][ENG-3054][ENG-3057] A11y Best Practice Fixes (#57)
* Remove redundant role="main" in <main> * Fix order to headings (i.e. <h1>, <h2>, <h3>, etc.) * Customize heading styles and use them semantically in order
1 parent 115082f commit ca771d1

29 files changed

Lines changed: 67 additions & 30 deletions

src/main/resources/static/css/cas.css

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,45 @@ a:hover, a:visited, a:active {
4848
color: var(--cas-theme-primary-light);
4949
}
5050

51+
h1 {
52+
font-size: 1.5em;
53+
margin-block-start: 0.83em;
54+
margin-block-end: 0.83em;
55+
}
56+
57+
h2,
58+
h1.downsize-to-h2 {
59+
font-size: 1.17em;
60+
margin-block-start: 1em;
61+
margin-block-end: 1em;
62+
}
63+
64+
h3,
65+
h2.downsize-to-h3 {
66+
font-size: 1em;
67+
margin-block-start: 1.33em;
68+
margin-block-end: 1.33em;
69+
}
70+
71+
h4,
72+
h3.downsize-to-h4 {
73+
font-size: 0.83em;
74+
margin-block-start: 1.67em;
75+
margin-block-end: 1.67em;
76+
}
77+
78+
h5, h6 {
79+
font-size: 0.67em;
80+
margin-block-start: 2.33em;
81+
margin-block-end: 2.33em;
82+
}
83+
5184
h1, h2, h3, h4, h5, h6 {
85+
display: block;
5286
margin-top: 0;
87+
margin-inline-start: 0;
88+
margin-inline-end: 0;
89+
font-weight: bold;
5390
}
5491

5592
aside, section, main {

src/main/resources/templates/casAccountDisabledView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</section>
2525
<hr class="my-4" />
2626
<section class="card-message">
27-
<h2 th:utext="#{screen.accountdisabled.heading}"></h2>
27+
<h1 th:utext="#{screen.accountdisabled.heading}"></h1>
2828
<p th:utext="#{screen.accountdisabled.message}"></p>
2929
</section>
3030
<section class="form-button">

src/main/resources/templates/casAccountNotConfirmedIdPView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</section>
2525
<hr class="my-4" />
2626
<section class="card-message">
27-
<h2 th:utext="#{screen.accountnotconfirmedidp.heading}"></h2>
27+
<h1 th:utext="#{screen.accountnotconfirmedidp.heading}"></h1>
2828
<p th:utext="#{screen.accountnotconfirmedidp.message}"></p>
2929
</section>
3030
<section class="form-button">

src/main/resources/templates/casAccountNotConfirmedOsfView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</section>
2525
<hr class="my-4" />
2626
<section class="card-message">
27-
<h2 th:utext="#{screen.accountnotconfirmedosf.heading}"></h2>
27+
<h1 th:utext="#{screen.accountnotconfirmedosf.heading}"></h1>
2828
<p th:utext="#{screen.accountnotconfirmedosf.message}"></p>
2929
</section>
3030
<section class="form-button">

src/main/resources/templates/casGenericSuccessView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</section>
2525
<hr class="my-4" />
2626
<section class="card-message">
27-
<h2 th:utext="#{screen.generic.loginsuccess.heading}"></h2>
27+
<h1 th:utext="#{screen.generic.loginsuccess.heading}"></h1>
2828
<div th:utext="#{screen.generic.loginsuccess.message}"></div>
2929
</section>
3030
<section id="authnAttr" class="pre-formatted-small word-break-all">

src/main/resources/templates/casInstitutionLoginView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</section>
3232

3333
<section class="card-message">
34-
<h2 th:utext="#{screen.institutionlogin.heading}"></h2>
34+
<h1 th:utext="#{screen.institutionlogin.heading}"></h1>
3535
<p th:unless=${osfCasLoginContext.institutionId} th:utext="#{screen.institutionlogin.message.select}"></p>
3636
<p th:if=${osfCasLoginContext.institutionId} th:utext="#{screen.institutionlogin.message.auto}"></p>
3737
</section>

src/main/resources/templates/casInstitutionSsoFailedView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</section>
2525
<hr class="my-4" />
2626
<section class="card-message">
27-
<h2 th:utext="#{screen.institutionssofailed.heading}"></h2>
27+
<h1 th:utext="#{screen.institutionssofailed.heading}"></h1>
2828
<p th:utext="#{screen.institutionssofailed.message}"></p>
2929
</section>
3030
<section class="form-button" th:with="loginUrl=@{${@casServerLoginUrl}(casRedirectSource=cas)}">

src/main/resources/templates/casInvalidUserStatusView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</section>
2525
<hr class="my-4" />
2626
<section class="card-message">
27-
<h2 th:utext="#{screen.invaliduserstatus.heading}"></h2>
27+
<h1 th:utext="#{screen.invaliduserstatus.heading}"></h1>
2828
<p th:utext="#{screen.invaliduserstatus.message}"></p>
2929
</section>
3030
<section class="form-button">

src/main/resources/templates/casInvalidVerificationKeyView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</section>
2525
<hr class="my-4" />
2626
<section class="card-message">
27-
<h2 th:utext="#{screen.invalidverificationkey.heading}"></h2>
27+
<h1 th:utext="#{screen.invalidverificationkey.heading}"></h1>
2828
<p th:utext="#{screen.invalidverificationkey.message}"></p>
2929
</section>
3030
<section class="form-button">

src/main/resources/templates/casLogoutView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</section>
2525
<hr class="my-4" />
2626
<section class="card-message">
27-
<h2 th:utext="#{screen.generic.logoutsuccess.heading}"></h2>
27+
<h1 th:utext="#{screen.generic.logoutsuccess.heading}"></h1>
2828
<div th:utext="#{screen.generic.logoutsuccess.message}"></div>
2929
</section>
3030
<section class="form-button">

0 commit comments

Comments
 (0)