File tree Expand file tree Collapse file tree 5 files changed +69
-3
lines changed
Expand file tree Collapse file tree 5 files changed +69
-3
lines changed Original file line number Diff line number Diff line change 102102 }
103103
104104 & .active {
105- @apply text-blue text-lg;
105+ @apply text-lg;
106+ color : var (--sidebar-active-link-color );
106107
107108 .home-icon {
108109 @apply inline-block;
116117 }
117118
118119 .home-title {
119- @apply relative pl-0 text-blue;
120+ @apply relative pl-0;
121+ color : var (--sidebar-active-link-color );
120122 left : -2 px ;
121123 }
122124 }
Original file line number Diff line number Diff line change 22 <main class =" page" >
33 <slot name =" top" />
44
5- <Content id =" content" class =" theme-default-content" />
5+ <Content id =" content" class =" theme-default-content" tabindex = " -1 " />
66
77 <PageNav v-bind =" { sidebarItems }" />
88
Original file line number Diff line number Diff line change 55 @touchstart =" onTouchStart"
66 @touchend =" onTouchEnd"
77 >
8+ <span ref =" backToTop" tabindex =" -1" />
9+ <ul class =" skip-links" >
10+ <li >
11+ <a @click =" handleSkipLink" href =" #content" class =" skip-link" >Skip to main content</a >
12+ </li >
13+ </ul >
814 <div id =" nprogress-container" ></div >
915 <div class =" sidebar-mask" @click =" toggleSidebar(false)" />
1016 <LeftBar
@@ -179,6 +185,12 @@ export default {
179185 Hamburger,
180186 },
181187
188+ watch: {
189+ ' $route.path' () {
190+ this .$refs .backToTop .focus ()
191+ }
192+ },
193+
182194 data : () => ({
183195 isSidebarOpen: false ,
184196 isSidebarTransitioning: false ,
@@ -358,6 +370,16 @@ export default {
358370 this .$emit (" toggle-sidebar" , this .isSidebarOpen );
359371 },
360372
373+ handleSkipLink (event ) {
374+ event .preventDefault ();
375+ const {target } = event ;
376+ const skipLinkTarget = this .$el .querySelector (target .getAttribute (' href' ));
377+
378+ if (skipLinkTarget) {
379+ skipLinkTarget .focus ({focusVisible: false });
380+ }
381+ },
382+
361383 handleWidthChange () {
362384 if (typeof document === " undefined" ) {
363385 return ;
Original file line number Diff line number Diff line change 2323 --custom-block-bg-color : theme ("colors.softer" );
2424 --custom-block-border-color : theme ("colors.soft" );
2525 --craft-red : #e5422b ;
26+ --white : theme ("colors.white" );
27+ --black : theme ("colors.black" );
2628 --custom-focus-outline : 2 px solid var (--link-color-default );
2729
30+ /* Custom button */
31+ --button-background-color : theme ("colors.blue.default" );
32+ --button-text-color : var (--white );
33+ --button-border-color : theme ("colors.blue.darker" );
34+ --button-border-radius : 4 px ;
35+
2836 /* Code */
2937 --code-color-default : #476582 ;
3038 --code-color-gold : #8A6700 ;
6977 color : var (--link-color-default );
7078}
7179
80+ .skip-links {
81+ list-style : none;
82+ }
83+
84+ .skip-link {
85+ white-space : nowrap;
86+ top : .5 em ;
87+ position : fixed;
88+ left : -1000 px ;
89+ opacity : 0 ;
90+ background-color : var (--button-background-color );
91+ color : var (--button-text-color );
92+ font-weight : 500 ;
93+ padding : .75 em 1.5 em ;
94+ border : 1 px solid var (--button-border-color );
95+ border-radius : var (--button-border-radius );
96+ }
97+
98+ .skip-link:focus {
99+ opacity : 1 ;
100+ z-index : 100 ;
101+ left : .5 em ;
102+ }
103+
72104img {
73105 @apply max-w-full;
74106}
Original file line number Diff line number Diff line change 2929 --sidebar-active-link-color : var (--link-color-default );
3030 --code-link-color : theme ("colors.blue.lighter" );
3131
32+ /* Buttons */
33+ --button-background-color : theme ("colors.gray.800" );
34+ --button-text-color : var (--white );
35+ --button-border-color : #818EA2 ;
36+
3237 /* Code */
3338 --code-color-default : #7F9CB8 ;
3439 --code-color-gold : #BD8E00 ;
6772 --sidebar-active-link-color : var (--link-color-default );
6873 --code-link-color : theme ("colors.blue.lighter" );
6974
75+ /* Buttons */
76+ --button-background-color : theme ("colors.gray.800" );
77+ --button-text-color : var (--white );
78+ --button-border-color : #818EA2 ;
79+
7080 /* Code */
7181 --code-color-default : #7F9CB8 ;
7282 --code-color-gold : #BD8E00 ;
You can’t perform that action at this time.
0 commit comments