@@ -47,6 +47,7 @@ export type UUIButtonType = 'submit' | 'button' | 'reset';
47
47
* @cssprop --uui-button-contrast-hover - overwrite the text color for hover state
48
48
* @cssprop --uui-button-contrast-disabled - overwrite the text color for disabled state
49
49
* @cssprop --uui-button-content-align - Overwrite justify-content alignment. Possible values: 'left', 'right', 'center'.
50
+ * @cssprop --uui-button-transition - Add transition to the button. Default is none.
50
51
*/
51
52
@defineElement ( 'uui-button' )
52
53
export class UUIButtonElement extends UUIFormControlMixin (
@@ -335,7 +336,14 @@ export class UUIButtonElement extends UUIFormControlMixin(
335
336
calc (var (--uui-size-2 ) * var (--uui-button-padding-left-factor ));
336
337
337
338
box-shadow : none;
339
+
340
+ transition : var (--uui-button-transition , none);
341
+ }
342
+
343
+ # button : focus-visible {
344
+ outline : 2px solid var (--color-emphasis );
338
345
}
346
+
339
347
button [disabled ]: active ,
340
348
a : not ([href ]): active {
341
349
animation : ${ UUIHorizontalShakeAnimationValue } ;
@@ -354,25 +362,6 @@ export class UUIButtonElement extends UUIFormControlMixin(
354
362
color : inherit;
355
363
}
356
364
357
- /* ANIMATIONS */
358
- @keyframes fadeIn {
359
- 0% {
360
- opacity : 0 ;
361
- }
362
- 100% {
363
- opacity : 1 ;
364
- }
365
- }
366
-
367
- @keyframes fadeOut {
368
- 0% {
369
- opacity : 1 ;
370
- }
371
- 100% {
372
- opacity : 0 ;
373
- }
374
- }
375
-
376
365
/* edge case for default color */
377
366
: host (: not ([color ]): not ([look = 'primary' ])),
378
367
: host ([color = '' ]: not ([look = 'primary' ])),
@@ -452,6 +441,7 @@ export class UUIButtonElement extends UUIFormControlMixin(
452
441
/* special for primary: */
453
442
font-weight : var (--uui-button-font-weight , 700 );
454
443
}
444
+
455
445
: host ([look = 'primary' ]: hover ) # button {
456
446
background-color : var (
457
447
--uui-button-background-color-hover ,
@@ -460,6 +450,12 @@ export class UUIButtonElement extends UUIFormControlMixin(
460
450
color : var (--uui-button-contrast-hover , var (--color-contrast ));
461
451
border-color : var (--uui-button-border-color-hover , transparent);
462
452
}
453
+
454
+ /* special outline offset tof primary style so you can see the outline */
455
+ : host ([look = 'primary' ]) # button : focus-visible {
456
+ outline-offset : 2px ;
457
+ }
458
+
463
459
: host ([look = 'primary' ][disabled ]) # button {
464
460
background-color : var (
465
461
--uui-button-background-color-disabled ,
0 commit comments