Skip to content

Commit 3ae7e4d

Browse files
author
MargeBot
committed
Merge branch 'vpn/task/vpnbe-1334-fix-tab-css' into 'main'
[VPNBE-1334] Fix Tab underline variant css See merge request web/clients!16930
2 parents 1328aca + 3699a13 commit 3ae7e4d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/components/components/tabs/Tabs.scss

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@import '~@proton/styles/scss/lib';
22

33
.tabs {
4-
&.withTransition > &-nav &-link {
4+
&.with-transition > &-nav &-link {
55
transition: 0.15s easing(ease-out-quint);
66
}
77

@@ -45,7 +45,7 @@
4545
}
4646
}
4747

48-
&--underline.withTransition > &-nav &-indicator {
48+
&--underline.with-transition > &-nav &-indicator {
4949
transition: transform 0.15s easing(ease-out-quad);
5050
}
5151

@@ -58,6 +58,14 @@
5858
transform: translateX(var(--tabs_translate)) scaleX(var(--tabs_scale));
5959
border-block-end: 2px solid var(--interaction-norm);
6060

61+
&.hides {
62+
transition: opacity 0.1s linear 0.1s;
63+
64+
&.hide {
65+
opacity: 0;
66+
}
67+
}
68+
6169
@at-root {
6270
[dir='rtl'] & {
6371
transform-origin: right center;
@@ -111,7 +119,7 @@
111119
}
112120
}
113121

114-
&--modern.withTransition > &-nav &-indicator {
122+
&--modern.with-transition > &-nav &-indicator {
115123
transition-property: transform, inline-size;
116124
transition-duration: 0.3s;
117125
transition-timing-function: easing(ease-out-quad);

packages/components/components/tabs/Tabs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export const Tabs = ({
109109
if (!isReady && translate !== undefined && scale !== undefined && width !== undefined) {
110110
setReady(true);
111111
setTimeout(() => {
112-
rootRef.current?.classList.add('withTransition');
112+
rootRef.current?.classList.add('with-transition');
113113
indicatortRef.current?.classList.remove('hides');
114114
}, 300 /* same with transition duration in css */);
115115
}
@@ -151,7 +151,7 @@ export const Tabs = ({
151151
role="tablist"
152152
ref={containerRef}
153153
style={
154-
translate && scale && width
154+
translate !== undefined && scale !== undefined && width !== undefined
155155
? { '--tabs_translate': translate, '--tabs_scale': scale, '--tabs_width': width }
156156
: {}
157157
}

0 commit comments

Comments
 (0)