Skip to content

Commit 3b3d95a

Browse files
committed
javascript and css proposed changes
1 parent 04740d0 commit 3b3d95a

File tree

3 files changed

+67
-5
lines changed

3 files changed

+67
-5
lines changed

docs/source/_static/css/ftc-rtd.css

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ html[data-theme='dark'] .card, .btn-block {
1414
.center {text-align: center;}
1515

1616
.color-strip {
17-
height: 10px;
17+
height: 20px;
1818
margin :0;
1919
padding: 0;
2020
position: relative;
@@ -62,6 +62,7 @@ html[data-theme='dark'] .card, .btn-block {
6262
width: auto;
6363
overflow-y: auto;
6464
margin-top: 10px;
65+
padding-top: 25px;
6566
}
6667

6768
.wy-nav-side {
@@ -145,3 +146,52 @@ div.ethical-sidebar, div.ethical-footer {
145146
.sphinx-tab img {
146147
margin-bottom: 24px;
147148
}
149+
150+
/* ADA compliance CSS */
151+
footer a, a.external { /* increase link text color contrast to dark blue, add underlines for links in the body (not in the sidebar) */
152+
color: #0000EE /* blue #003974 */ !important;
153+
text-decoration-line: underline !important;
154+
text-decoration-color: #0000EE !important;
155+
/*text-decoration-thickness: .125em !important;*/
156+
text-underline-offset: 0.2em !important;
157+
}
158+
footer a:visited, a.external:visited { /* visited is an important navigation feature for links */
159+
color: #551A8B /* purple #003974 */ !important;
160+
text-decoration-color: #551A8B !important;
161+
}
162+
footer a:focus, a.external:focus {
163+
outline: 2px solid #d71ef7;
164+
}
165+
footer a:hover, a.external:hover {
166+
font-weight: bold;
167+
}
168+
footer a:active, a.external:active {
169+
color: #FF0000 !important;
170+
}
171+
/* I noticed that we don't hightlight focus very well on the page.
172+
After a reload no focus is visible, if you start tabbbing there's some small indications of focus.
173+
Focus starts in the search the docs input field, but there's not indication of focus and it's not visible. */
174+
175+
176+
p.admonition-title { /* increase background contrast to dark blue */
177+
background: #003974 !important;
178+
}
179+
footer { /* increase text contrast, override grey*/
180+
color: black !important;
181+
}
182+
183+
/* ADA Skip navigation */
184+
.skip-nav {
185+
position: absolute;
186+
left: 0px; /* was -9999px */
187+
opacity: 0;
188+
z-index: 1000;
189+
background: white;
190+
/*color: white;*/
191+
}
192+
.skip-nav:focus {
193+
/*left: 0;*/
194+
/*transform: translateX(-50%);*/
195+
opacity: 1;
196+
}
197+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
$(document).ready(function () {
22
$('a.external').attr('target', '_blank');
33
$('a.external').attr('rel', 'noopener');
4+
emdash_loc = document.title.indexOf('\u2014');
5+
if (emdash_loc > 1) { /* ADA compliance, clean up title content. locate the emdash that separates the content from cruft */
6+
document.title = document.title.substring(0, emdash_loc-1);
7+
}
8+
/* skip to main content handling*/
9+
document.body.insertAdjacentHTML('afterbegin', '<a id="skip-link" class="skip-nav" tabindex="1" href="#main">Skip to main content</a>');
10+
document.querySelector("h1").insertAdjacentHTML('beforebegin', '<section id="main">');
11+
document.getElementById('skip-link').focus();
12+
13+
/* this didn't work as hoped, hitting tab went to the search box, not tabindex 1
14+
Test again with Jaws, maybe it will 'find' the first tabindex from the top of the page */
15+
document.getElementById('skip-link').blur(); /* we set focus away from the sidebar, then blur it */
416
});

docs/source/_templates/footer.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
{%- if hasdoc('copyright') %}
2424
{%- trans path=pathto('copyright'), copyright=copyright|e %}&#169; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
2525
{%- else %}
26-
&#169; 2023 <i>{%- trans copyright=copyright|e %}{{ copyright }}{% endtrans %}</i>
26+
&#169; 2024 <i>{%- trans copyright=copyright|e %}{{ copyright }}{% endtrans %}</i>
2727
{%- endif %}
2828
{%- endif %}
2929
</div>
3030

3131
<div>
32-
<a href="https://www.firstinspires.org/about/privacy-policy">Privacy Policy</a>
32+
<p style="margin-top: 0.5em;"><a class="external" href="https://www.firstinspires.org/about/privacy-policy">Privacy Policy</a></p>
3333
</div>
3434
<div>
35-
<a href="{{ pathto('tos/tos') }}">Terms of Service</a>
35+
<a class="external" href="{{ pathto('tos/tos') }}">Terms of Service</a>
3636
</div>
3737
<div>
38-
<a href="https://www.pavesuite.com/FIRST/PublicPortal/HomePage">Report an Incident</a>
38+
<p style="margin-top: 0.5em;"><a class="external" href="https://www.pavesuite.com/FIRST/PublicPortal/HomePage">Report an Incident</a></p>
3939
</div>
4040

4141
<div>

0 commit comments

Comments
 (0)