Skip to content

Commit c1a2aa4

Browse files
authored
no cursor default on active + clean up vars (#790)
* no cursor default on active + clean up vars * also have hover state when active
1 parent 46fde86 commit c1a2aa4

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

packages/uui-tabs/lib/uui-tab.element.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ export class UUITabElement extends ActiveMixin(LabelMixin('', LitElement)) {
135135
var(--uui-tab-padding-horizontal, var(--uui-size-5));
136136
}
137137
138-
:host(:not([active]):not([disabled])) #button:hover {
138+
:host(:not([disabled])) #button:hover {
139139
color: var(--uui-tab-text-hover, var(--uui-color-default-emphasis));
140140
}
141141
142-
:host(:not([active]):not([disabled])) #button:active {
142+
:host(:not([disabled])) #button:active {
143143
box-shadow:
144144
inset 0 2px 4px rgba(0, 0, 0, 0.15),
145145
0 1px 2px rgba(0, 0, 0, 0.05);
@@ -149,9 +149,6 @@ export class UUITabElement extends ActiveMixin(LabelMixin('', LitElement)) {
149149
color: var(--uui-tab-text-active, unset);
150150
}
151151
152-
:host([active]) #button {
153-
cursor: default;
154-
}
155152
:host([disabled]) #button {
156153
color: var(--uui-color-disabled-contrast);
157154
cursor: default;
@@ -162,9 +159,6 @@ export class UUITabElement extends ActiveMixin(LabelMixin('', LitElement)) {
162159
position: absolute;
163160
background-color: var(--uui-color-current);
164161
opacity: 0;
165-
--transitionDuration: 120ms;
166-
--barWidth: 4px;
167-
--borderRadius: 3px;
168162
}
169163
:host([active]) #button::before {
170164
opacity: 1;
@@ -174,32 +168,32 @@ export class UUITabElement extends ActiveMixin(LabelMixin('', LitElement)) {
174168
:host([orientation='horizontal']) #button::before {
175169
left: auto;
176170
right: auto;
177-
border-radius: var(--borderRadius) var(--borderRadius) 0 0;
171+
border-radius: var(--uui-border-radius) var(--uui-border-radius) 0 0;
178172
height: 0px;
179173
width: calc(100% - 15px);
180174
bottom: 0;
181175
transition:
182-
opacity ease-in-out var(--transitionDuration),
183-
height ease-in-out var(--transitionDuration);
176+
opacity linear 120ms,
177+
height ease-in-out 120ms;
184178
}
185179
:host([active][orientation='horizontal']) #button::before {
186-
height: var(--barWidth);
180+
height: 4px;
187181
}
188182
189183
/* VERTICAL */
190184
:host([orientation='vertical']) #button::before {
191185
top: auto;
192186
bottom: auto;
193-
border-radius: 0 var(--borderRadius) var(--borderRadius) 0;
187+
border-radius: 0 var(--uui-border-radius) var(--uui-border-radius) 0;
194188
height: calc(100% - 12px);
195189
width: 0px;
196190
left: 0;
197191
transition:
198-
opacity ease-in-out var(--transitionDuration),
199-
width ease-in-out var(--transitionDuration);
192+
opacity linear 120ms,
193+
width ease-in-out 120ms;
200194
}
201195
:host([active][orientation='vertical']) #button::before {
202-
width: var(--barWidth);
196+
width: 4px;
203197
}
204198
205199
#button:hover::before {

0 commit comments

Comments
 (0)