_buttons.scss 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. // shared styles
  2. .btn,
  3. .btn-flat {
  4. border: $button-border;
  5. border-radius: $button-radius;
  6. display: inline-block;
  7. height: $button-height;
  8. line-height: $button-height;
  9. padding: $button-padding;
  10. text-transform: uppercase;
  11. vertical-align: middle;
  12. -webkit-tap-highlight-color: transparent; // Gets rid of tap active state
  13. }
  14. // Disabled shared style
  15. .btn.disabled,
  16. .btn-floating.disabled,
  17. .btn-large.disabled,
  18. .btn-small.disabled,
  19. .btn-flat.disabled,
  20. .btn:disabled,
  21. .btn-floating:disabled,
  22. .btn-large:disabled,
  23. .btn-small:disabled,
  24. .btn-flat:disabled,
  25. .btn[disabled],
  26. .btn-floating[disabled],
  27. .btn-large[disabled],
  28. .btn-small[disabled],
  29. .btn-flat[disabled] {
  30. pointer-events: none;
  31. background-color: $button-disabled-background !important;
  32. box-shadow: none;
  33. color: $button-disabled-color !important;
  34. cursor: default;
  35. &:hover {
  36. background-color: $button-disabled-background !important;
  37. color: $button-disabled-color !important;
  38. }
  39. }
  40. // Shared icon styles
  41. .btn,
  42. .btn-floating,
  43. .btn-large,
  44. .btn-small,
  45. .btn-flat {
  46. font-size: $button-font-size;
  47. outline: 0;
  48. i {
  49. font-size: $button-icon-font-size;
  50. line-height: inherit;
  51. }
  52. }
  53. // Shared focus button style
  54. .btn,
  55. .btn-floating {
  56. &:focus {
  57. background-color: darken($button-raised-background, 10%);
  58. }
  59. }
  60. // Raised Button
  61. .btn {
  62. text-decoration: none;
  63. color: $button-raised-color;
  64. background-color: $button-raised-background;
  65. text-align: center;
  66. letter-spacing: .5px;
  67. @extend .z-depth-1;
  68. transition: background-color .2s ease-out;
  69. cursor: pointer;
  70. &:hover {
  71. background-color: $button-raised-background-hover;
  72. @extend .z-depth-1-half;
  73. }
  74. }
  75. // Floating button
  76. .btn-floating {
  77. &:hover {
  78. background-color: $button-floating-background-hover;
  79. @extend .z-depth-1-half;
  80. }
  81. &:before {
  82. border-radius: 0;
  83. }
  84. &.btn-large {
  85. &.halfway-fab {
  86. bottom: -$button-floating-large-size / 2;
  87. }
  88. width: $button-floating-large-size;
  89. height: $button-floating-large-size;
  90. padding: 0;
  91. i {
  92. line-height: $button-floating-large-size;
  93. }
  94. }
  95. &.btn-small {
  96. &.halfway-fab {
  97. bottom: -$button-floating-small-size / 2;
  98. }
  99. width: $button-floating-small-size;
  100. height: $button-floating-small-size;
  101. i {
  102. line-height: $button-floating-small-size;
  103. }
  104. }
  105. &.halfway-fab {
  106. &.left {
  107. right: auto;
  108. left: 24px;
  109. }
  110. position: absolute;
  111. right: 24px;
  112. bottom: -$button-floating-size / 2;
  113. }
  114. display: inline-block;
  115. color: $button-floating-color;
  116. position: relative;
  117. overflow: hidden;
  118. z-index: 1;
  119. width: $button-floating-size;
  120. height: $button-floating-size;
  121. line-height: $button-floating-size;
  122. padding: 0;
  123. background-color: $button-floating-background;
  124. border-radius: $button-floating-radius;
  125. @extend .z-depth-1;
  126. transition: background-color .3s;
  127. cursor: pointer;
  128. vertical-align: middle;
  129. i {
  130. width: inherit;
  131. display: inline-block;
  132. text-align: center;
  133. color: $button-floating-color;
  134. font-size: $button-large-icon-font-size;
  135. line-height: $button-floating-size;
  136. }
  137. }
  138. // button fix
  139. button.btn-floating {
  140. border: $button-border;
  141. }
  142. // Fixed Action Button
  143. .fixed-action-btn {
  144. &.active {
  145. ul {
  146. visibility: visible;
  147. }
  148. }
  149. // Directions
  150. &.direction-left,
  151. &.direction-right {
  152. padding: 0 0 0 15px;
  153. ul {
  154. text-align: right;
  155. right: 64px;
  156. top: 50%;
  157. transform: translateY(-50%);
  158. height: 100%;
  159. left: auto;
  160. /*width 100% only goes to width of button container */
  161. width: 500px;
  162. li {
  163. display: inline-block;
  164. margin: 7.5px 15px 0 0;
  165. }
  166. }
  167. }
  168. &.direction-right {
  169. padding: 0 15px 0 0;
  170. ul {
  171. text-align: left;
  172. direction: rtl;
  173. left: 64px;
  174. right: auto;
  175. li {
  176. margin: 7.5px 0 0 15px;
  177. }
  178. }
  179. }
  180. &.direction-bottom {
  181. padding: 0 0 15px 0;
  182. ul {
  183. top: 64px;
  184. bottom: auto;
  185. display: flex;
  186. flex-direction: column-reverse;
  187. li {
  188. margin: 15px 0 0 0;
  189. }
  190. }
  191. }
  192. &.toolbar {
  193. &.active {
  194. &>a i {
  195. opacity: 0;
  196. }
  197. }
  198. padding: 0;
  199. height: $button-floating-large-size;
  200. ul {
  201. display: flex;
  202. top: 0;
  203. bottom: 0;
  204. z-index: 1;
  205. li {
  206. flex: 1;
  207. display: inline-block;
  208. margin: 0;
  209. height: 100%;
  210. transition: none;
  211. a {
  212. display: block;
  213. overflow: hidden;
  214. position: relative;
  215. width: 100%;
  216. height: 100%;
  217. background-color: transparent;
  218. box-shadow: none;
  219. color: #fff;
  220. line-height: $button-floating-large-size;
  221. z-index: 1;
  222. i {
  223. line-height: inherit;
  224. }
  225. }
  226. }
  227. }
  228. }
  229. position: fixed;
  230. right: 23px;
  231. bottom: 23px;
  232. padding-top: 15px;
  233. margin-bottom: 0;
  234. z-index: 997;
  235. ul {
  236. left: 0;
  237. right: 0;
  238. text-align: center;
  239. position: absolute;
  240. bottom: 64px;
  241. margin: 0;
  242. visibility: hidden;
  243. li {
  244. margin-bottom: 15px;
  245. }
  246. a.btn-floating {
  247. opacity: 0;
  248. }
  249. }
  250. .fab-backdrop {
  251. position: absolute;
  252. top: 0;
  253. left: 0;
  254. z-index: -1;
  255. width: $button-floating-size;
  256. height: $button-floating-size;
  257. background-color: $button-floating-background;
  258. border-radius: $button-floating-radius;
  259. transform: scale(0);
  260. }
  261. }
  262. // Flat button
  263. .btn-flat {
  264. box-shadow: none;
  265. background-color: transparent;
  266. color: $button-flat-color;
  267. cursor: pointer;
  268. transition: background-color .2s;
  269. &:focus,
  270. &:hover {
  271. box-shadow: none;
  272. color: $button-flat-color-hover !important;
  273. }
  274. &:focus {
  275. background-color: rgba(0, 0, 0, .1);
  276. }
  277. &.disabled,
  278. &.btn-flat[disabled] {
  279. background-color: transparent !important;
  280. color: $button-flat-disabled-color !important;
  281. cursor: default;
  282. }
  283. }
  284. // Large button
  285. .btn-large {
  286. @extend .btn;
  287. height: $button-large-height;
  288. line-height: $button-large-height;
  289. font-size: $button-large-font-size;
  290. padding: 0 28px;
  291. i {
  292. font-size: $button-large-icon-font-size;
  293. }
  294. }
  295. // Small button
  296. .btn-small {
  297. @extend .btn;
  298. height: $button-small-height;
  299. line-height: $button-small-height;
  300. font-size: $button-small-font-size;
  301. i {
  302. font-size: $button-small-icon-font-size;
  303. }
  304. }
  305. // Block button
  306. .btn-block {
  307. display: block;
  308. }