File tree 3 files changed +30
-1
lines changed
theme/pydata_sphinx_theme
3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ $grid-breakpoints: (
33
33
@import " ./base/base" ;
34
34
35
35
// Major theme layout, skeleton, and whitespace
36
+ @import " ./sections/skip-link" ;
36
37
@import " ./sections/container" ;
37
38
@import " ./sections/announcement" ;
38
39
@import " ./sections/article" ;
Original file line number Diff line number Diff line change
1
+ /* ******************************************************************************
2
+ * Rules for the UX/UI of skip navigation link btn. It's only visible to people
3
+ * navigating with keyboard for accecibility purposes
4
+ * ref: https://www.youtube.com/watch?v=VUR0I5mqq7I
5
+ */
6
+ .skip-link {
7
+ position : fixed ;
8
+ top : 0 ;
9
+ left : 0 ;
10
+ right : 0 ;
11
+ text-align : center ;
12
+ background-color : var (--pst-color-background );
13
+ color : var (--pst-color-link );
14
+ padding : 0.5rem ;
15
+ translate : 0 -100% ;
16
+ transition : translate 150ms ease-in-out ;
17
+ z-index : $zindex-modal ;
18
+ border-bottom : 1px solid var (--pst-color-border );
19
+
20
+ & :focus {
21
+ translate : 0 ;
22
+ }
23
+ }
Original file line number Diff line number Diff line change 46
46
{# set up with scrollspy to update the toc as we scroll #}
47
47
{# ref: https://getbootstrap.com/docs/4.0/components/scrollspy/ #}
48
48
< body data-spy ="scroll " data-target ="#bd-toc-nav " data-offset ="180 " data-default-mode ="{{ default_mode }} ">
49
+
50
+ {# A button hidden by default to help assistive devices quickly jump to main content #}
51
+ {# ref: https://www.youtube.com/watch?v=VUR0I5mqq7I #}
52
+ < a class ="skip-link " href ="#main-content "> {{ _("Skip to main content") }}</ a >
53
+
49
54
{%- endblock %}
50
55
51
56
{%- block content %}
84
89
< div class ="bd-sidebar-primary bd-sidebar{% if not sidebars %} hide-on-wide{% endif %} ">
85
90
{% include "sections/sidebar-primary.html" %}
86
91
</ div >
87
- < main class ="bd-main ">
92
+ < main id =" main-content " class ="bd-main ">
88
93
{# Main content area #}
89
94
{% block docs_main %}
90
95
< div class ="bd-content ">
You can’t perform that action at this time.
0 commit comments