Skip to content

Commit f9d27fa

Browse files
authored
feat(tab-title): enhance component's interactivity states (#11493)
**Related Issue:** [#10003](#10003) ## Summary - Increase `bottom-border` to `4px` on `focus` when `selected=true`. - Change `text-color-3` to `text-color-1` on `hover` and `active` when `bordered=false` and `selected=false`. - When `bordered=true`: - Remove `hover` and `active` states when `selected=true`. - Change `text-color-3` to `text-color-1` on `hover` and `active` when `selected=false`.
1 parent 755f1cf commit f9d27fa

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

packages/calcite-components/src/components/tab-title/tab-title.scss

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@
117117
border-block-end: 1px solid transparent;
118118
}
119119

120+
:host(:not([bordered])) .container {
121+
&:hover,
122+
&:active {
123+
@apply text-color-1;
124+
}
125+
}
126+
120127
:host([bordered]:not([selected]):hover) .container:not(.container--bottom) {
121128
border-block-end: 1px solid var(--calcite-color-border-1);
122129
}
@@ -151,10 +158,6 @@
151158
inset-block-start: -1px;
152159
}
153160

154-
:host([bordered][selected]:hover) .container::after {
155-
background: var(--calcite-color-foreground-2);
156-
}
157-
158161
:host([bordered][selected]:focus) .container::after {
159162
background: transparent;
160163
}
@@ -178,6 +181,12 @@
178181
background-color: var(--calcite-color-brand);
179182
}
180183

184+
:host([selected]:focus) {
185+
.selected-indicator {
186+
block-size: 4px;
187+
}
188+
}
189+
181190
@media (forced-colors: active) {
182191
.selected-indicator {
183192
background-color: highlight;
@@ -285,6 +294,11 @@
285294

286295
// bordered styles
287296
:host([bordered]) .container {
297+
&:hover,
298+
&:active {
299+
@apply text-color-1;
300+
}
301+
288302
&:not(.container--bottom) .close-button {
289303
block-size: calc(100% - var(--calcite-spacing-px));
290304
margin-block-start: -1px;
@@ -334,6 +348,10 @@
334348

335349
:host([selected][bordered]) .container {
336350
border-inline-color: var(--calcite-color-border-1);
351+
&:hover,
352+
&:active {
353+
background: transparent;
354+
}
337355
}
338356

339357
:host([layout="inline"][bordered]),

0 commit comments

Comments
 (0)