Geen omschrijving

button.scss 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. .components-button {
  2. &.is-default {
  3. color: $studio-gray-70;
  4. border-color: $studio-gray-10;
  5. background: $white;
  6. box-shadow: none;
  7. border-width: 1px 1px 2px;
  8. &:hover {
  9. background: $white;
  10. border-color: $studio-gray-20;
  11. box-shadow: none;
  12. color: $studio-gray-70;
  13. }
  14. &:focus:enabled {
  15. background: $white;
  16. color: $studio-gray-70;
  17. border-color: $color-primary;
  18. box-shadow: 0 0 0 2px $color-primary-light;
  19. }
  20. &:active:enabled {
  21. background: $white;
  22. border-color: $studio-gray-10;
  23. border-width: 2px 1px 1px;
  24. box-shadow: none;
  25. }
  26. &:disabled,
  27. &[aria-disabled='true'] {
  28. color: $studio-gray-50;
  29. background-color: $white;
  30. border-color: $studio-gray-50;
  31. text-shadow: none;
  32. }
  33. }
  34. &.is-primary {
  35. background: $color-accent;
  36. border-color: $color-accent-dark;
  37. box-shadow: none;
  38. color: $white;
  39. text-shadow: none;
  40. &:focus:enabled {
  41. background: $studio-pink-40;
  42. border-color: $color-accent;
  43. color: $white;
  44. box-shadow: 0 0 0 2px $color-accent-light;
  45. }
  46. &:hover {
  47. box-shadow: none;
  48. background: $studio-pink-40;
  49. border-color: $color-accent-dark;
  50. color: $white;
  51. }
  52. &:focus:enabled {
  53. box-shadow: 0 0 0 2px $color-accent-light;
  54. }
  55. &:active:enabled {
  56. background: $studio-pink-40;
  57. border-color: $color-accent-dark;
  58. box-shadow: inset 0 1px 0 $color-accent-dark;
  59. }
  60. &:disabled,
  61. &[aria-disabled='true'] {
  62. color: $studio-gray-50;
  63. background: $white;
  64. border-color: $studio-gray-50;
  65. text-shadow: none;
  66. &:hover,
  67. &:focus,
  68. &:active {
  69. color: $studio-gray-50;
  70. background-color: $white;
  71. border-color: $studio-gray-50;
  72. box-shadow: none;
  73. }
  74. }
  75. &.is-busy,
  76. &.is-busy:disabled,
  77. &.is-busy[aria-disabled='true'] {
  78. background-image: linear-gradient(
  79. -45deg,
  80. $color-accent 28%,
  81. $studio-pink-60 28%,
  82. $studio-pink-60 72%,
  83. $color-accent 72%
  84. );
  85. border-color: $color-accent-dark;
  86. }
  87. }
  88. /* Buttons that look like links, for a cross of good semantics with the visual */
  89. &.is-link {
  90. color: $color-link;
  91. &:hover,
  92. &:active {
  93. color: $color-link-dark;
  94. }
  95. &:focus {
  96. color: $color-link-dark;
  97. box-shadow: 0 0 0 2px $color-primary-light;
  98. }
  99. }
  100. /* Link buttons that are red to indicate destructive behavior. */
  101. &.is-link.is-destructive {
  102. color: $alert-red;
  103. }
  104. &:focus:enabled {
  105. // @include button-style__focus-active;
  106. }
  107. &.is-busy {
  108. background-image: repeating-linear-gradient(
  109. -45deg,
  110. $studio-gray-50,
  111. $white 11px,
  112. $white 10px,
  113. $studio-gray-50 20px
  114. );
  115. }
  116. // Buttons that are text-based.
  117. &.is-tertiary {
  118. color: $color-link;
  119. &:not( :disabled ):not( [aria-disabled='true'] ):not( .is-default ):hover {
  120. color: $color-link-dark;
  121. }
  122. }
  123. }