button.sass 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. =button-small
  2. border-radius: $radius-small
  3. font-size: 11px
  4. height: 24px
  5. line-height: 16px
  6. padding-left: 6px
  7. padding-right: 6px
  8. =button-medium
  9. font-size: 18px
  10. height: 40px
  11. padding-left: 14px
  12. padding-right: 14px
  13. =button-large
  14. font-size: 22px
  15. height: 48px
  16. padding-left: 20px
  17. padding-right: 20px
  18. .button
  19. +control
  20. @extend .unselectable
  21. justify-content: center
  22. padding-left: 10px
  23. padding-right: 10px
  24. text-align: center
  25. white-space: nowrap
  26. strong
  27. color: inherit
  28. small
  29. display: block
  30. font-size: $size-small
  31. line-height: 1
  32. margin-top: 5px
  33. .icon,
  34. .tag
  35. &:first-child
  36. margin-left: -2px
  37. margin-right: 4px
  38. &:last-child
  39. margin-left: 4px
  40. margin-right: -2px
  41. &:hover,
  42. &:focus,
  43. &.is-active
  44. color: $control-hover
  45. &:active
  46. box-shadow: inset 0 1px 2px rgba($black, 0.2)
  47. // Colors
  48. @each $name, $pair in $colors
  49. $color: nth($pair, 1)
  50. $color-invert: nth($pair, 2)
  51. &.is-#{$name}
  52. background-color: $color
  53. border-color: transparent
  54. color: $color-invert
  55. &:hover,
  56. &:focus,
  57. &.is-active
  58. background-color: darken($color, 10%)
  59. border-color: transparent
  60. color: $color-invert
  61. &:active
  62. border-color: transparent
  63. &.is-inverted
  64. background-color: $color-invert
  65. color: $color
  66. &:hover
  67. background-color: darken($color-invert, 5%)
  68. &.is-loading
  69. &:after
  70. border-color: transparent transparent $color-invert $color-invert !important
  71. &.is-outlined
  72. background-color: transparent
  73. border-color: $color
  74. color: $color
  75. &:hover,
  76. &:focus
  77. background-color: $color
  78. border-color: $color
  79. color: $color-invert
  80. &.is-link
  81. background-color: transparent
  82. border-color: transparent
  83. color: $text
  84. text-decoration: underline
  85. &:hover,
  86. &:focus
  87. background-color: $border
  88. color: $text-strong
  89. // Sizes
  90. &.is-small
  91. +button-small
  92. &.is-medium
  93. +button-medium
  94. &.is-large
  95. +button-large
  96. // Modifiers
  97. &[disabled],
  98. &.is-disabled
  99. opacity: 0.5
  100. &.is-fullwidth
  101. display: flex
  102. width: 100%
  103. &.is-loading
  104. color: transparent !important
  105. pointer-events: none
  106. &:after
  107. @extend .loader
  108. +center(16px)
  109. position: absolute !important