File tree 5 files changed +77
-20
lines changed
5 files changed +77
-20
lines changed Original file line number Diff line number Diff line change 48
48
"@commitlint/config-conventional" : " ^13.2.0" ,
49
49
"@release-it/conventional-changelog" : " ^5.1.1" ,
50
50
"@stencil-community/postcss" : " ^2.2.0" ,
51
- "@stencil/core" : " ^4.12.2 " ,
51
+ "@stencil/core" : " ^4.12.3 " ,
52
52
"@stencil/react-output-target" : " ^0.5.3" ,
53
53
"@stencil/sass" : " ^3.0.4" ,
54
54
"@stencil/vue-output-target" : " ^0.8.6" ,
Original file line number Diff line number Diff line change @@ -127,8 +127,6 @@ export class GoTablist {
127
127
this . deactivateTabs ( ) ;
128
128
const tabId = tabEl . getAttribute ( 'id' ) ;
129
129
130
- this . activeTabRect = tabEl . getBoundingClientRect ( ) ;
131
-
132
130
this . tabsState = this . tabsState . map ( ( tab , i ) => {
133
131
if ( tab . tabId === tabId ) {
134
132
this . activeIndex = i ;
@@ -150,6 +148,10 @@ export class GoTablist {
150
148
index : this . activeIndex ,
151
149
tabEl,
152
150
} ) ;
151
+
152
+ requestAnimationFrame ( ( ) => {
153
+ this . activeTabRect = tabEl . getBoundingClientRect ( ) ;
154
+ } ) ;
153
155
}
154
156
155
157
// When a tab is clicked, activateTab is fired to activate it
Original file line number Diff line number Diff line change
1
+ go-tabs {
2
+ --tab-padding : 0.75rem 1.25rem ;
3
+ --tab-bg-color : transparent ;
4
+ --tab-hover-bg-color : var (--go-color-neutral-200 );
5
+ --tab-text-color : var (--go-color-neutral-700 );
6
+ --tab-focus-color : var (--go-color-primary-600 );
7
+ --tab-active-color : var (--go-color-primary-800 );
8
+ --tab-active-bg-color : transparent ;
9
+ --tab-border-width : 0.2em ;
10
+ --tab-active-indicator-color : var (--tab-active-color );
11
+ --tabs-active-indicator-width : 0 ;
12
+ --tabs-active-indicator-height : 0.2em ;
13
+ --tabs-active-indicator-color : var (--tab-active-color );
14
+ --tabs-vertical-tablist-max-width : 25% ;
15
+ --tabs-tablist-gap : 1rem ;
16
+
17
+ & .vertical {
18
+ display : grid ;
19
+ grid-template-columns : minmax (min-content , var (--tabs-vertical-tablist-max-width )) 1fr ;
20
+ gap : var (--tabs-tablist-gap );
21
+ [role = ' tablist' ] {
22
+ .tabs-active-indicator-track {
23
+ width : auto ;
24
+ top : 0 ;
25
+ left : auto ;
26
+ .tabs-active-indicator {
27
+ --tabs-active-indicator-width : 4px ;
28
+ transform : translateY (var (--tabs-active-indicator-top ));
29
+ }
30
+ }
31
+ }
32
+ [role = ' tab' ] {
33
+ text-align : start ;
34
+ white-space : normal ;
35
+ & :focus-visible {
36
+ border-top-color : transparent ;
37
+ border-left-color : var (--tab-focus-color );
38
+ }
39
+ }
40
+ }
41
+ }
Original file line number Diff line number Diff line change 29
29
30
30
<!-- keep this sandbox empty before pushing changes -->
31
31
< div class ="container ">
32
- < go-tabs fill >
32
+ < go-tabs fill vertical >
33
33
< go-tab label ="Icon tab " icon-position ="before ">
34
34
< go-icon name ="home " slot ="icon "> </ go-icon >
35
35
< p >
You can’t perform that action at this time.
0 commit comments