File tree 3 files changed +5
-12
lines changed 3 files changed +5
-12
lines changed Original file line number Diff line number Diff line change 13
13
import sideNavStyles from '@adobe/spectrum-css-temp/components/sidenav/vars.css' ;
14
14
15
15
export function attachToToC ( ) {
16
+ let main = document . getElementsByTagName ( 'main' ) [ 0 ] ;
16
17
let tocLinks = document . querySelectorAll ( '#toc a' ) ;
17
18
let headers = [ ] ;
18
19
for ( let link of tocLinks ) {
@@ -26,7 +27,7 @@ export function attachToToC() {
26
27
// this needs to be improved a little but the math hurts my head right now
27
28
// right now it's impossible to select the last section if the last two heights combined are smaller than the viewport height
28
29
headers . some ( ( header , i ) => {
29
- if ( ( header . header . offsetTop + header . header . getBoundingClientRect ( ) . height ) > document . documentElement . scrollTop ) {
30
+ if ( ( header . header . offsetTop + header . header . getBoundingClientRect ( ) . height ) > main . scrollTop + main . offsetTop ) {
30
31
let currentSelection = document . querySelectorAll ( `#toc .${ sideNavStyles [ 'is-selected' ] } ` ) ;
31
32
if ( currentSelection ) {
32
33
currentSelection . forEach ( node => {
@@ -47,5 +48,5 @@ export function attachToToC() {
47
48
48
49
updateToc ( ) ;
49
50
50
- document . addEventListener ( 'scroll' , updateToc ) ;
51
+ main . addEventListener ( 'scroll' , updateToc ) ;
51
52
}
Original file line number Diff line number Diff line change @@ -295,8 +295,7 @@ html, body {
295
295
main {
296
296
margin-top : var (--spectrum-global-dimension-size-550 );
297
297
margin-left : 256px ;
298
- margin-right : 180px ;
299
- padding : 0 52px ;
298
+ padding : 0 244px 0 52px ;
300
299
box-sizing : border-box;
301
300
display : flex;
302
301
height : calc (100vh - var (--spectrum-global-dimension-size-550 ));
@@ -738,13 +737,6 @@ h2.sectionHeader {
738
737
}
739
738
}
740
739
741
- @media (max-width : 1200px ) {
742
- /* Hide the table of contents */
743
- main {
744
- margin-right : 0 ;
745
- }
746
- }
747
-
748
740
@define-mixin small-propTable {
749
741
/* Collapse the prop table into a list with key/value pairs */
750
742
.propTable {
Original file line number Diff line number Diff line change 13
13
.toc {
14
14
position : fixed;
15
15
top : 80px ;
16
- right : 8 px ;
16
+ right : 20 px ;
17
17
overflow-y : auto;
18
18
max-height : calc (100vh - 80px );
19
19
}
You can’t perform that action at this time.
0 commit comments