123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. @import "../../themes/ionic.globals.md";
  2. // Material Design Button
  3. // --------------------------------------------------
  4. // deprecated
  5. $button-md-margin: null !default;
  6. /// @prop - Margin top of the button
  7. $button-md-margin-top: .4rem !default;
  8. /// @prop - Margin end of the button
  9. $button-md-margin-end: .2rem !default;
  10. /// @prop - Margin bottom of the button
  11. $button-md-margin-bottom: .4rem !default;
  12. /// @prop - Margin start of the button
  13. $button-md-margin-start: .2rem !default;
  14. // deprecated
  15. $button-md-padding: null !default;
  16. /// @prop - Padding top of the button
  17. $button-md-padding-top: 0 !default;
  18. /// @prop - Padding end of the button
  19. $button-md-padding-end: 1.1em !default;
  20. /// @prop - Padding bottom of the button
  21. $button-md-padding-bottom: $button-md-padding-top !default;
  22. /// @prop - Padding start of the button
  23. $button-md-padding-start: $button-md-padding-end !default;
  24. /// @prop - Height of the button
  25. $button-md-height: 3.6rem !default;
  26. /// @prop - Border radius of the button
  27. $button-md-border-radius: 2px !default;
  28. /// @prop - Font size of the button text
  29. $button-md-font-size: 1.4rem !default;
  30. /// @prop - Font weight of the button text
  31. $button-md-font-weight: 500 !default;
  32. /// @prop - Capitalization of the button text
  33. $button-md-text-transform: uppercase !default;
  34. /// @prop - Background color of the button
  35. $button-md-background-color: color($colors-md, primary) !default;
  36. /// @prop - Text color of the button
  37. $button-md-text-color: color-contrast($colors-md, $button-md-background-color) !default;
  38. /// @prop - Box shadow of the button
  39. $button-md-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12) !default;
  40. /// @prop - Duration of the transition of the button
  41. $button-md-transition-duration: 300ms !default;
  42. /// @prop - Speed curve of the transition of the button
  43. $button-md-transition-timing-function: cubic-bezier(.4, 0, .2, 1) !default;
  44. /// @prop - Background color of the button on hover
  45. $button-md-background-color-hover: $button-md-background-color !default;
  46. /// @prop - Background color of the activated button
  47. $button-md-background-color-activated: color-shade($button-md-background-color) !default;
  48. /// @prop - Opacity of the activated button
  49. $button-md-opacity-activated: 1 !default;
  50. /// @prop - Box shadow of the activated button
  51. $button-md-box-shadow-activated: 0 3px 5px rgba(0, 0, 0, .14), 0 3px 5px rgba(0, 0, 0, .21), 0 0 0 0 transparent !default;
  52. /// @prop - Background color of the ripple on the button
  53. $button-md-ripple-background-color: #555 !default;
  54. // Material Design Large Button
  55. // --------------------------------------------------
  56. // deprecated
  57. $button-md-large-padding: null !default;
  58. /// @prop - Padding top of the large button
  59. $button-md-large-padding-top: 0 !default;
  60. /// @prop - Padding end of the large button
  61. $button-md-large-padding-end: 1em !default;
  62. /// @prop - Padding bottom of the large button
  63. $button-md-large-padding-bottom: $button-md-large-padding-top !default;
  64. /// @prop - Padding start of the large button
  65. $button-md-large-padding-start: $button-md-large-padding-end !default;
  66. /// @prop - Height of the large button
  67. $button-md-large-height: 2.8em !default;
  68. /// @prop - Font size of the large button
  69. $button-md-large-font-size: 2rem !default;
  70. // Material Design Small Button
  71. // --------------------------------------------------
  72. // deprecated
  73. $button-md-small-padding: null !default;
  74. /// @prop - Padding top of the small button
  75. $button-md-small-padding-top: 0 !default;
  76. /// @prop - Padding end of the small button
  77. $button-md-small-padding-end: .9em !default;
  78. /// @prop - Padding bottom of the small button
  79. $button-md-small-padding-bottom: $button-md-small-padding-top !default;
  80. /// @prop - Padding start of the small button
  81. $button-md-small-padding-start: $button-md-small-padding-end !default;
  82. /// @prop - Height of the small button
  83. $button-md-small-height: 2.1em !default;
  84. /// @prop - Font size of the small button
  85. $button-md-small-font-size: 1.3rem !default;
  86. /// @prop - Font size of an icon in the small button
  87. $button-md-small-icon-font-size: 1.4em !default;
  88. // Material Design Outline Button
  89. // --------------------------------------------------
  90. /// @prop - Border width of the outline button
  91. $button-md-outline-border-width: 1px !default;
  92. /// @prop - Border style of the outline button
  93. $button-md-outline-border-style: solid !default;
  94. /// @prop - Border color of the outline button
  95. $button-md-outline-border-color: $button-md-background-color !default;
  96. /// @prop - Text color of the outline button
  97. $button-md-outline-text-color: $button-md-background-color !default;
  98. /// @prop - Background color of the outline button
  99. $button-md-outline-background-color: transparent !default;
  100. /// @prop - Box shadow of the outline button
  101. $button-md-outline-box-shadow: none !default;
  102. /// @prop - Background color of the outline button on hover
  103. $button-md-outline-background-color-hover: rgba(158, 158, 158, .1) !default;
  104. /// @prop - Background color of the activated outline button
  105. $button-md-outline-background-color-activated: transparent !default;
  106. /// @prop - Box shadow of the activated outline button
  107. $button-md-outline-box-shadow-activated: none !default;
  108. /// @prop - Opacity of the activated outline button
  109. $button-md-outline-opacity-activated: 1 !default;
  110. /// @prop - Background color of the ripple on the outline button
  111. $button-md-outline-ripple-background-color: $button-md-background-color !default;
  112. // Material Design Clear Button
  113. // --------------------------------------------------
  114. /// @prop - Border color of the clear button
  115. $button-md-clear-border-color: transparent !default;
  116. /// @prop - Text color of the clear button
  117. $button-md-clear-text-color: $button-md-background-color !default;
  118. /// @prop - Background color of the clear button
  119. $button-md-clear-background-color: transparent !default;
  120. /// @prop - Box shadow of the clear button
  121. $button-md-clear-box-shadow: none !default;
  122. /// @prop - Opacity of the clear button
  123. $button-md-clear-opacity: 1 !default;
  124. /// @prop - Background color of the activated clear button
  125. $button-md-clear-background-color-activated: rgba(158, 158, 158, .2) !default;
  126. /// @prop - Box shadow of the activated clear button
  127. $button-md-clear-box-shadow-activated: $button-md-clear-box-shadow !default;
  128. /// @prop - Background color of the clear button on hover
  129. $button-md-clear-background-color-hover: rgba(158, 158, 158, .1) !default;
  130. /// @prop - Background color of the ripple on the clear button
  131. $button-md-clear-ripple-background-color: #999 !default;
  132. // Material Design Round Button
  133. // --------------------------------------------------
  134. // deprecated
  135. $button-md-round-padding: null !default;
  136. /// @prop - Padding top of the round button
  137. $button-md-round-padding-top: $button-round-padding-top !default;
  138. /// @prop - Padding end of the round button
  139. $button-md-round-padding-end: $button-round-padding-end !default;
  140. /// @prop - Padding bottom of the round button
  141. $button-md-round-padding-bottom: $button-round-padding-bottom !default;
  142. /// @prop - Padding start of the round button
  143. $button-md-round-padding-start: $button-round-padding-start !default;
  144. /// @prop - Border radius of the round button
  145. $button-md-round-border-radius: $button-round-border-radius !default;
  146. // Material Design Decorator Button
  147. // --------------------------------------------------
  148. /// @prop - Font weight of the strong button
  149. $button-md-strong-font-weight: bold !default;
  150. // Material Design Default Button
  151. // --------------------------------------------------
  152. .button-md {
  153. @include border-radius($button-md-border-radius);
  154. overflow: hidden;
  155. height: $button-md-height;
  156. font-size: $button-md-font-size;
  157. font-weight: $button-md-font-weight;
  158. text-transform: $button-md-text-transform;
  159. color: $button-md-text-color;
  160. background-color: $button-md-background-color;
  161. box-shadow: $button-md-box-shadow;
  162. transition: box-shadow $button-md-transition-duration $button-md-transition-timing-function,
  163. background-color $button-md-transition-duration $button-md-transition-timing-function,
  164. color $button-md-transition-duration $button-md-transition-timing-function;
  165. @include deprecated-variable(margin, $button-md-margin) {
  166. @include margin($button-md-margin-top, $button-md-margin-end, $button-md-margin-bottom, $button-md-margin-start);
  167. }
  168. @include deprecated-variable(padding, $button-md-padding) {
  169. @include padding($button-md-padding-top, $button-md-padding-end, $button-md-padding-bottom, $button-md-padding-start);
  170. }
  171. }
  172. .button-md:hover:not(.disable-hover) {
  173. background-color: $button-md-background-color-hover;
  174. }
  175. .button-md.activated {
  176. background-color: $button-md-background-color-activated;
  177. box-shadow: $button-md-box-shadow-activated;
  178. }
  179. .button-md .button-effect {
  180. background-color: $button-md-text-color;
  181. }
  182. // Material Design Default Button Color Mixin
  183. // --------------------------------------------------
  184. @mixin md-button-default($color-name, $color-base, $color-contrast) {
  185. $bg-color: $color-base;
  186. $bg-color-activated: color-shade($bg-color);
  187. $fg-color: $color-contrast;
  188. .button-md-#{$color-name} {
  189. color: $fg-color;
  190. background-color: $bg-color;
  191. }
  192. .button-md-#{$color-name}:hover:not(.disable-hover) {
  193. background-color: $bg-color;
  194. }
  195. .button-md-#{$color-name}.activated {
  196. background-color: $bg-color-activated;
  197. opacity: $button-md-opacity-activated;
  198. }
  199. .button-md-#{$color-name} .button-effect {
  200. background-color: $fg-color;
  201. }
  202. }
  203. // Material Design Button Sizes
  204. // --------------------------------------------------
  205. .button-large-md {
  206. height: $button-md-large-height;
  207. font-size: $button-md-large-font-size;
  208. @include deprecated-variable(padding, $button-md-large-padding) {
  209. @include padding($button-md-large-padding-top, $button-md-large-padding-end, $button-md-large-padding-bottom, $button-md-large-padding-start);
  210. }
  211. }
  212. .button-small-md {
  213. height: $button-md-small-height;
  214. font-size: $button-md-small-font-size;
  215. @include deprecated-variable(padding, $button-md-small-padding) {
  216. @include padding($button-md-small-padding-top, $button-md-small-padding-end, $button-md-small-padding-bottom, $button-md-small-padding-start);
  217. }
  218. }
  219. .button-small-md[icon-only] ion-icon {
  220. font-size: $button-md-small-icon-font-size;
  221. }
  222. // Material Design Block Button
  223. // --------------------------------------------------
  224. .button-block-md {
  225. @include margin-horizontal(0);
  226. }
  227. // Material Design Full Button
  228. // --------------------------------------------------
  229. .button-full-md {
  230. @include margin-horizontal(0);
  231. @include border-radius(0);
  232. border-right-width: 0;
  233. border-left-width: 0;
  234. }
  235. // Material Design Outline Button
  236. // --------------------------------------------------
  237. .button-outline-md {
  238. border-width: $button-md-outline-border-width;
  239. border-style: $button-md-outline-border-style;
  240. border-color: $button-md-outline-border-color;
  241. color: $button-md-outline-text-color;
  242. background-color: $button-md-outline-background-color;
  243. box-shadow: $button-md-outline-box-shadow;
  244. }
  245. .button-outline-md:hover:not(.disable-hover) {
  246. background-color: $button-md-outline-background-color-hover;
  247. }
  248. .button-outline-md.activated {
  249. background-color: $button-md-outline-background-color-activated;
  250. box-shadow: $button-md-outline-box-shadow-activated;
  251. opacity: $button-md-outline-opacity-activated;
  252. }
  253. .button-outline-md .button-effect {
  254. background-color: $button-md-outline-ripple-background-color;
  255. }
  256. // Material Design Outline Button Color Mixin
  257. // --------------------------------------------------
  258. @mixin md-button-outline($color-name, $color-base, $color-contrast) {
  259. $fg-color: color-shade($color-base, 5%);
  260. .button-outline-md-#{$color-name} {
  261. border-color: $fg-color;
  262. color: $fg-color;
  263. background-color: $button-md-outline-background-color;
  264. }
  265. .button-outline-md-#{$color-name}:hover:not(.disable-hover) {
  266. background-color: $button-md-outline-background-color-hover;
  267. }
  268. .button-outline-md-#{$color-name}.activated {
  269. background-color: $button-md-outline-background-color-activated;
  270. }
  271. .button-outline-md-#{$color-name} .button-effect {
  272. background-color: $fg-color;
  273. }
  274. }
  275. // Material Design Clear Button
  276. // --------------------------------------------------
  277. .button-clear-md {
  278. border-color: $button-md-clear-border-color;
  279. color: $button-md-background-color;
  280. background-color: $button-md-clear-background-color;
  281. box-shadow: $button-md-clear-box-shadow;
  282. opacity: $button-md-clear-opacity;
  283. }
  284. .button-clear-md.activated {
  285. background-color: $button-md-clear-background-color-activated;
  286. box-shadow: $button-md-clear-box-shadow-activated;
  287. }
  288. .button-clear-md:hover:not(.disable-hover) {
  289. background-color: $button-md-clear-background-color-hover;
  290. }
  291. .button-clear-md .button-effect {
  292. background-color: $button-md-clear-ripple-background-color;
  293. }
  294. // Material Design Clear Button Color Mixin
  295. // --------------------------------------------------
  296. @mixin md-button-clear($color-name, $color-base, $color-contrast) {
  297. $fg-color: $color-base;
  298. .button-clear-md-#{$color-name} {
  299. border-color: $button-md-clear-border-color;
  300. color: $fg-color;
  301. background-color: $button-md-clear-background-color;
  302. }
  303. .button-clear-md-#{$color-name}.activated {
  304. background-color: $button-md-clear-background-color-activated;
  305. box-shadow: $button-md-clear-box-shadow-activated;
  306. }
  307. .button-clear-md-#{$color-name}:hover:not(.disable-hover) {
  308. color: $fg-color;
  309. }
  310. }
  311. // Material Design Round Button
  312. // --------------------------------------------------
  313. .button-round-md {
  314. @include border-radius($button-md-round-border-radius);
  315. @include deprecated-variable(padding, $button-md-round-padding) {
  316. @include padding($button-md-round-padding-top, $button-md-round-padding-end, $button-md-round-padding-bottom, $button-md-round-padding-start);
  317. }
  318. }
  319. .button-md [icon-only] {
  320. @include padding(0);
  321. }
  322. // Material Design Ripple Effect
  323. // --------------------------------------------------
  324. // Only Material uses the button effect, so by default
  325. // it's display none, and .md sets to display block.
  326. .button-effect {
  327. @include border-radius(50%);
  328. @include transform-origin(center, center);
  329. position: absolute;
  330. z-index: 0;
  331. display: none;
  332. background-color: $button-md-ripple-background-color;
  333. opacity: .2;
  334. transition-timing-function: ease-in-out;
  335. pointer-events: none;
  336. @include multi-dir() {
  337. // scss-lint:disable PropertySpelling
  338. top: 0;
  339. left: 0;
  340. }
  341. }
  342. .md button .button-effect {
  343. display: block;
  344. }
  345. // Generate Material Design Button Colors
  346. // --------------------------------------------------
  347. @each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
  348. @include md-button-default($color-name, $color-base, $color-contrast);
  349. @include md-button-outline($color-name, $color-base, $color-contrast);
  350. @include md-button-clear($color-name, $color-base, $color-contrast);
  351. }
  352. // MD strong Button
  353. // --------------------------------------------------
  354. .button-strong-md {
  355. font-weight: $button-md-strong-font-weight;
  356. }