@@ -63,7 +63,7 @@ export function SiteSectionTabs(props: {
63
63
< nav
64
64
aria-label = "Sections"
65
65
ref = { navRef }
66
- className = "flex flex-nowrap items-center mb-px"
66
+ className = "flex flex-nowrap items-center mb-px max-w-screen-2xl mx-auto page-full-width:max-w-full "
67
67
style = {
68
68
{
69
69
'--tab-opacity' : `${ opacity } ` ,
@@ -72,47 +72,52 @@ export function SiteSectionTabs(props: {
72
72
} as React . CSSProperties
73
73
}
74
74
>
75
- < div
76
- className = { tcls (
77
- 'relative' ,
78
- 'flex' ,
79
- 'gap-2' ,
80
- 'bg-transparent' ,
81
-
82
- // Horizontal padding, which is the layout padding minus the padding of the tabs themselves.
83
- 'px-1' ,
84
- 'sm:px-3' ,
85
- 'md:px-5' ,
86
-
87
- /* add a pseudo element for active tab indicator */
88
- 'after:block' ,
89
- "after:content-['']" ,
90
- 'after:origin-left' ,
91
- 'after:absolute' ,
92
- 'after:-bottom-px' ,
93
- 'after:left-0' ,
94
- 'after:opacity-[--tab-opacity]' ,
95
- 'after:scale-x-[--tab-scale]' ,
96
- 'after:[transition:_opacity_150ms_25ms,transform_150ms]' ,
97
- 'after:motion-reduce:transition-none' ,
98
- 'after:translate-x-[var(--tab-start)]' ,
99
- 'after:will-change-transform' ,
100
- 'after:h-0.5' ,
101
- 'after:w-[100px]' ,
102
- 'after:bg-primary' ,
103
- 'dark:after:bg-primary-400' ,
104
- ) }
105
- role = "tablist"
106
- >
107
- { tabs . map ( ( tab , index ) => (
108
- < Tab
109
- active = { currentIndex === index }
110
- key = { index + tab . path }
111
- label = { tab . label }
112
- href = { tab . path }
113
- ref = { currentIndex === index ? currentTabRef : null }
114
- />
115
- ) ) }
75
+ < div className = "flex flex-col bg-transparent" >
76
+ { /* An element for the tabs which includes the page padding */ }
77
+ < div
78
+ role = "tablist"
79
+ className = { tcls (
80
+ 'flex flex-row gap-2' ,
81
+ // Horizontal padding, which is the layout padding minus the padding of the tabs themselves.
82
+ 'px-1' ,
83
+ 'sm:px-3' ,
84
+ 'md:px-5' ,
85
+ ) }
86
+ >
87
+ { tabs . map ( ( tab , index ) => (
88
+ < Tab
89
+ active = { currentIndex === index }
90
+ key = { index + tab . path }
91
+ label = { tab . label }
92
+ href = { tab . path }
93
+ ref = { currentIndex === index ? currentTabRef : null }
94
+ />
95
+ ) ) }
96
+ </ div >
97
+ { /* A container for a pseudo element for active tab indicator. A container is needed so we can set
98
+ a relative position without breaking the z-index of other parts of the header. */ }
99
+ < div
100
+ className = { tcls (
101
+ 'flex' ,
102
+ 'relative' ,
103
+ 'after:block' ,
104
+ "after:content-['']" ,
105
+ 'after:origin-left' ,
106
+ 'after:absolute' ,
107
+ 'after:-bottom-px' ,
108
+ 'after:left-0' ,
109
+ 'after:opacity-[--tab-opacity]' ,
110
+ 'after:scale-x-[--tab-scale]' ,
111
+ 'after:[transition:_opacity_150ms_25ms,transform_150ms]' ,
112
+ 'after:motion-reduce:transition-none' ,
113
+ 'after:translate-x-[var(--tab-start)]' ,
114
+ 'after:will-change-transform' ,
115
+ 'after:h-0.5' ,
116
+ 'after:w-[100px]' ,
117
+ 'after:bg-primary' ,
118
+ 'dark:after:bg-primary-400' ,
119
+ ) }
120
+ > </ div >
116
121
</ div >
117
122
</ nav >
118
123
) : null ;
0 commit comments