|
22 | 22 | /// @param {Color} $hover-foreground [null] - The hover text color of the button.
|
23 | 23 | /// @param {Color} $focus-background [null] - The focus background color of the button.
|
24 | 24 | /// @param {Color} $focus-foreground [null] - The focus text color of the button.
|
| 25 | +/// @param {Color} $active-background [null] - The active background of the button. |
| 26 | +/// @param {Color} $active-foreground [null] - The active text color of the button. |
25 | 27 | /// @param {Number} $border-radius [null] - The border radius of the button.
|
26 | 28 | /// @param {Color} $border-color [null] - The border color of the button.
|
27 | 29 | /// @param {Color} $shadow-color [null] - The shadow color of the button.
|
|
61 | 63 | $focus-background: null,
|
62 | 64 | $focus-foreground: null,
|
63 | 65 |
|
| 66 | + $active-background: null, |
| 67 | + $active-foreground: null, |
| 68 | +
|
64 | 69 | $border-radius: null,
|
65 | 70 | $border-color: null,
|
66 | 71 |
|
|
159 | 164 | focus-background: $focus-background,
|
160 | 165 | focus-foreground: $focus-foreground,
|
161 | 166 |
|
| 167 | + active-background: $active-background, |
| 168 | + active-foreground: $active-foreground, |
| 169 | + |
162 | 170 | border-radius: $_border-radius,
|
163 | 171 | border-color: $border-color,
|
164 | 172 |
|
|
224 | 232 | $button-floating-width: rem(56px);
|
225 | 233 | $button-floating-height: $button-floating-width;
|
226 | 234 |
|
227 |
| - $button-icon-width: rem(36px, 16px); |
| 235 | + $button-icon-width: map.get(( |
| 236 | + material: rem(36px, 16px), |
| 237 | + fluent: rem(32px, 16px), |
| 238 | + bootstrap: rem(36px, 16px), |
| 239 | + indigo-design: rem(36px, 16px), |
| 240 | + ), $variant); |
| 241 | + |
228 | 242 | $button-icon-height: $button-icon-width;
|
229 | 243 | $button-icon-font-size: rem(24px, 24px);
|
230 | 244 | $button-icon-padding: 0;
|
|
322 | 336 | compact: rem(4px)
|
323 | 337 | );
|
324 | 338 |
|
325 |
| - $icon-in-button-size: rem(18px); |
| 339 | + $icon-sizes: map.get(( |
| 340 | + material: rem(18px), |
| 341 | + fluent: rem(16px), |
| 342 | + bootstrap: rem(18px), |
| 343 | + indigo-design: rem(18px), |
| 344 | + ), $variant); |
| 345 | + $icon-in-button-size: $icon-sizes; |
326 | 346 |
|
327 | 347 | $raised-shadow: map.get((
|
328 | 348 | material: var-get($raised-theme, 'resting-shadow'),
|
|
429 | 449 | color: var-get($flat-theme, 'foreground');
|
430 | 450 | border-radius: var-get($flat-theme, 'border-radius');
|
431 | 451 |
|
| 452 | + |
432 | 453 | &:hover {
|
433 | 454 | background: var-get($flat-theme, 'hover-background');
|
434 | 455 | color: var-get($flat-theme, 'hover-foreground');
|
435 | 456 | }
|
436 | 457 |
|
437 | 458 | &:focus,
|
438 | 459 | &:active {
|
439 |
| - background: var-get($flat-theme, 'focus-background'); |
440 |
| - color: var-get($flat-theme, 'focus-foreground'); |
| 460 | + @if($variant != 'fluent') { |
| 461 | + background: var-get($flat-theme, 'focus-background'); |
| 462 | + color: var-get($flat-theme, 'focus-foreground'); |
| 463 | + } |
441 | 464 | box-shadow: 0 0 0 rem(3px) var-get($flat-theme, 'shadow-color');
|
442 | 465 | }
|
| 466 | + |
| 467 | + @if($variant == 'fluent') { |
| 468 | + border: rem(1px) solid transparent; |
| 469 | + |
| 470 | + &:active { |
| 471 | + color: var-get($flat-theme, 'active-foreground'); |
| 472 | + } |
| 473 | + |
| 474 | + &:focus-visible { |
| 475 | + border-color: var-get($flat-theme, 'border-color'); |
| 476 | + } |
| 477 | + } |
443 | 478 | }
|
444 | 479 |
|
445 | 480 | %igx-button--outlined {
|
|
466 | 501 |
|
467 | 502 | &:focus,
|
468 | 503 | &:active {
|
469 |
| - background: var-get($outlined-theme, 'focus-background'); |
| 504 | + @if($variant != 'fluent') { |
| 505 | + background: var-get($outlined-theme, 'focus-background'); |
| 506 | + } |
470 | 507 | color: var-get($outlined-theme, 'focus-foreground');
|
471 | 508 | box-shadow: 0 0 0 rem(3px) var-get($outlined-theme, 'shadow-color');
|
472 | 509 | }
|
| 510 | + |
| 511 | + @if($variant == 'fluent') { |
| 512 | + &:active { |
| 513 | + background: var-get($outlined-theme, 'active-background'); |
| 514 | + color: var-get($outlined-theme, 'active-foreground'); |
| 515 | + } |
| 516 | + |
| 517 | + &:focus-visible { |
| 518 | + &::after { |
| 519 | + $outline-btn-indent: rem(2px); |
| 520 | + content: ''; |
| 521 | + position: absolute; |
| 522 | + top: $outline-btn-indent; |
| 523 | + left: $outline-btn-indent; |
| 524 | + pointer-events: none; |
| 525 | + width: calc(100% - (#{$outline-btn-indent} * 2)); |
| 526 | + height: calc(100% - (#{$outline-btn-indent} * 2)); |
| 527 | + box-shadow: 0 0 0 rem(1px) var-get($outlined-theme, 'border-color'); |
| 528 | + } |
| 529 | + } |
| 530 | + } |
473 | 531 | }
|
474 | 532 |
|
475 | 533 | %igx-button--outlined-cosy {
|
|
504 | 562 |
|
505 | 563 | &:focus,
|
506 | 564 | &:active {
|
507 |
| - color: var-get($raised-theme, 'focus-foreground'); |
508 |
| - background: var-get($raised-theme, 'focus-background'); |
509 |
| - |
510 | 565 | @if $variant == 'material' or $variant == 'fluent' {
|
511 | 566 | box-shadow: 0 0 0 rem(3px) var-get($raised-theme, 'shadow-color'), $raised-shadow--focus;
|
512 | 567 | } @else {
|
513 | 568 | box-shadow: $raised-shadow--focus;
|
514 | 569 | }
|
515 | 570 | }
|
| 571 | + |
| 572 | + &:focus { |
| 573 | + color: var-get($raised-theme, 'focus-foreground'); |
| 574 | + background: var-get($raised-theme, 'focus-background'); |
| 575 | + } |
| 576 | + |
| 577 | + &:active { |
| 578 | + color: var-get($raised-theme, 'active-foreground'); |
| 579 | + background: var-get($raised-theme, 'active-background'); |
| 580 | + } |
| 581 | + |
| 582 | + @if($variant == 'fluent') { |
| 583 | + &:focus-visible { |
| 584 | + &::after { |
| 585 | + $outline-btn-indent: rem(3px); |
| 586 | + content: ''; |
| 587 | + position: absolute; |
| 588 | + top: $outline-btn-indent; |
| 589 | + left: $outline-btn-indent; |
| 590 | + pointer-events: none; |
| 591 | + width: calc(100% - (#{$outline-btn-indent} * 2)); |
| 592 | + height: calc(100% - (#{$outline-btn-indent} * 2)); |
| 593 | + box-shadow: 0 0 0 rem(1px) var-get($outlined-theme, 'border-color'); |
| 594 | + } |
| 595 | + } |
| 596 | + } |
516 | 597 | }
|
517 | 598 |
|
518 | 599 | %igx-button--round {
|
|
551 | 632 |
|
552 | 633 | &:focus,
|
553 | 634 | &:active {
|
554 |
| - color: var-get($fab-theme, 'focus-foreground'); |
555 |
| - background: var-get($fab-theme, 'focus-background'); |
556 |
| - |
557 | 635 | @if $variant == 'material' or $variant == 'fluent' {
|
558 | 636 | box-shadow: 0 0 0 rem(3px) var-get($fab-theme, 'shadow-color'), $fab-shadow--focus;
|
559 | 637 | } @else {
|
560 | 638 | box-shadow: $raised-shadow--focus;
|
561 | 639 | }
|
562 | 640 | }
|
563 | 641 |
|
| 642 | + &:focus { |
| 643 | + color: var-get($raised-theme, 'focus-foreground'); |
| 644 | + background: var-get($raised-theme, 'focus-background'); |
| 645 | + } |
| 646 | + |
| 647 | + &:active { |
| 648 | + color: var-get($raised-theme, 'active-foreground'); |
| 649 | + background: var-get($raised-theme, 'active-background'); |
| 650 | + } |
| 651 | + |
| 652 | + @if($variant == 'fluent') { |
| 653 | + &:focus-visible { |
| 654 | + &::after { |
| 655 | + $outline-btn-indent: rem(3px); |
| 656 | + content: ''; |
| 657 | + position: absolute; |
| 658 | + top: $outline-btn-indent; |
| 659 | + left: $outline-btn-indent; |
| 660 | + pointer-events: none; |
| 661 | + border-radius: calc(#{var-get($fab-theme, 'border-radius')} - #{$outline-btn-indent}); |
| 662 | + width: calc(100% - (#{$outline-btn-indent} * 2)); |
| 663 | + height: calc(100% - (#{$outline-btn-indent} * 2)); |
| 664 | + box-shadow: 0 0 0 rem(1px) var-get($outlined-theme, 'border-color'); |
| 665 | + } |
| 666 | + } |
| 667 | + } |
| 668 | + |
564 | 669 | @include icon-w-margin(
|
565 | 670 | map.get($icon-in-button-margin, 'comfortable'),
|
566 | 671 | $left
|
|
600 | 705 | background: var-get($icon-theme, 'background');
|
601 | 706 | border-radius: var-get($icon-theme, 'border-radius');
|
602 | 707 |
|
| 708 | + @if $variant == 'fluent' { |
| 709 | + border: 1px solid transparent; |
| 710 | + } |
| 711 | + |
603 | 712 | &:hover {
|
604 |
| - transition: $button-transition; |
| 713 | + @if $variant != 'fluent' { |
| 714 | + transition: $button-transition; |
| 715 | + } |
| 716 | + |
605 | 717 | color: var-get($icon-theme, 'hover-foreground');
|
606 | 718 | background: var-get($icon-theme, 'hover-background');
|
607 | 719 | }
|
608 | 720 |
|
609 |
| - &:focus, |
| 721 | + &:focus { |
| 722 | + color: var-get($icon-theme, 'focus-foreground'); |
| 723 | + |
| 724 | + @if $variant != 'fluent' { |
| 725 | + background: var-get($icon-theme, 'focus-background'); |
| 726 | + } |
| 727 | + |
| 728 | + &:hover { |
| 729 | + color: var-get($icon-theme, 'hover-foreground'); |
| 730 | + background: var-get($icon-theme, 'hover-background'); |
| 731 | + } |
| 732 | + |
| 733 | + &:active { |
| 734 | + color: var-get($icon-theme, 'active-foreground'); |
| 735 | + background: var-get($icon-theme, 'active-background'); |
| 736 | + } |
| 737 | + } |
| 738 | + |
610 | 739 | &:active {
|
| 740 | + color: var-get($icon-theme, 'active-foreground'); |
| 741 | + background: var-get($icon-theme, 'active-background'); |
| 742 | + } |
| 743 | + |
| 744 | + &:focus-visible { |
611 | 745 | color: var-get($icon-theme, 'focus-foreground');
|
612 |
| - background: var-get($icon-theme, 'focus-background'); |
613 | 746 |
|
| 747 | + @if $variant == 'fluent' { |
| 748 | + border: rem(1px) solid var-get($icon-theme, 'border-color') ; |
| 749 | + } |
| 750 | + |
| 751 | + &:hover { |
| 752 | + color: var-get($icon-theme, 'hover-foreground'); |
| 753 | + background: var-get($icon-theme, 'hover-background'); |
| 754 | + } |
| 755 | + } |
| 756 | + |
| 757 | + &:focus, |
| 758 | + &:active { |
614 | 759 | @if $variant == 'material' or $variant == 'fluent' {
|
615 | 760 | box-shadow: 0 0 0 rem(3px) var-get($icon-theme, 'shadow-color'), $icon-shadow;
|
616 | 761 | } @else {
|
|
625 | 770 | color: var-get($flat-theme, 'disabled-foreground');
|
626 | 771 | background: transparent;
|
627 | 772 |
|
| 773 | + @if $variant == 'fluent' { |
| 774 | + &%igx-button--outlined { |
| 775 | + background: var-get($flat-theme, 'disabled-background'); |
| 776 | + } |
| 777 | + |
| 778 | + &%igx-button--icon { |
| 779 | + background: var-get($flat-theme, 'disabled-background'); |
| 780 | + } |
| 781 | + } |
| 782 | + |
628 | 783 | &%igx-button--raised,
|
629 | 784 | &%igx-button--fab {
|
630 | 785 | background: var-get($flat-theme, 'disabled-background');
|
|
0 commit comments