button.scss 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. @import '../mixins';
  2. .btn.btn-ds {
  3. --bs-btn-font-family: var(--ds-font-family-sans);
  4. --bs-btn-border-radius: var(--ds-border-radius-200);
  5. &:focus-visible {
  6. @include ds-focus-outline;
  7. }
  8. // Default size
  9. @include ol-button-size(
  10. $font-size: var(--ds-font-size-400),
  11. $line-height: var(--ds-font-line-height-600),
  12. $padding-x: var(--ds-spacing-400),
  13. $padding-y: var(--ds-spacing-100)
  14. );
  15. &.btn-lg {
  16. @include ol-button-size(
  17. $font-size: var(--ds-font-size-400),
  18. $line-height: var(--ds-font-line-height-600),
  19. $padding-x: var(--ds-spacing-400),
  20. $padding-y: var(--ds-spacing-250)
  21. );
  22. }
  23. &.btn-sm {
  24. @include ol-button-size(
  25. $font-size: var(--ds-font-size-350),
  26. $line-height: var(--ds-font-line-height-500),
  27. $padding-x: var(--ds-spacing-200),
  28. $padding-y: var(--ds-spacing-100)
  29. );
  30. }
  31. // Variants
  32. &.btn-primary {
  33. @include ol-button-variant(
  34. $color: var(--ds-color-white),
  35. $background: var(--ds-color-neutral-950),
  36. $hover-background: var(--ds-color-neutral-900),
  37. $active-background: var(--ds-color-neutral-800),
  38. $disabled-color: var(--ds-color-neutral-700),
  39. $disabled-background: var(--ds-color-neutral-100)
  40. );
  41. }
  42. &.btn-secondary {
  43. @include ol-button-variant(
  44. $color: var(--ds-color-neutral-950),
  45. $background: var(--ds-color-neutral-200),
  46. $hover-background: var(--ds-color-neutral-300),
  47. $active-background: var(--ds-color-neutral-400),
  48. $disabled-color: var(--ds-color-neutral-700),
  49. $disabled-background: var(--ds-color-neutral-100)
  50. );
  51. }
  52. &.btn-tertiary {
  53. @include ol-button-variant(
  54. $color: var(--ds-color-neutral-950),
  55. $background: var(--ds-color-white),
  56. $hover-background: var(--ds-color-neutral-100),
  57. $active-background: var(--ds-color-neutral-200),
  58. $disabled-color: var(--ds-color-neutral-700),
  59. $disabled-background: var(--ds-color-neutral-100)
  60. );
  61. }
  62. &.btn-danger {
  63. @include ol-button-variant(
  64. $color: var(--ds-color-white),
  65. $background: var(--ds-color-red-700),
  66. $hover-background: var(--ds-color-red-800),
  67. $active-background: var(--ds-color-red-900),
  68. $disabled-color: var(--ds-color-neutral-700),
  69. $disabled-background: var(--ds-color-neutral-100)
  70. );
  71. }
  72. &.button-loading {
  73. .spinner-container {
  74. display: flex;
  75. justify-content: center;
  76. align-items: center;
  77. .loading-spinner-small {
  78. border-width: 0.25em;
  79. height: 1.25rem;
  80. width: 1.25rem;
  81. }
  82. .loading-spinner-large {
  83. border-width: 0.25em;
  84. height: 1.5rem;
  85. width: 1.5rem;
  86. }
  87. .spinner-border {
  88. border-right-color: color-mix(
  89. in srgb,
  90. var(--bs-btn-color) 32%,
  91. var(--bs-btn-bg)
  92. );
  93. }
  94. }
  95. // Hide the text when the spinner is visible
  96. & > [aria-hidden='true'] {
  97. visibility: hidden;
  98. }
  99. }
  100. .button-content {
  101. display: inline-flex;
  102. align-items: center;
  103. gap: var(--ds-spacing-200); // Add gap between text and icons
  104. justify-content: center;
  105. }
  106. .btn-social-icon {
  107. height: 24px;
  108. width: 24px;
  109. padding: var(--ds-spacing-50);
  110. margin: 0;
  111. }
  112. }