button.wp.scss 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. @import "../../themes/ionic.globals.wp";
  2. // Windows Button
  3. // --------------------------------------------------
  4. // deprecated
  5. $button-wp-margin: null !default;
  6. /// @prop - Margin top of the button
  7. $button-wp-margin-top: .4rem !default;
  8. /// @prop - Margin end of the button
  9. $button-wp-margin-end: .2rem !default;
  10. /// @prop - Margin bottom of the button
  11. $button-wp-margin-bottom: .4rem !default;
  12. /// @prop - Margin start of the button
  13. $button-wp-margin-start: .2rem !default;
  14. // deprecated
  15. $button-wp-padding: null !default;
  16. /// @prop - Padding top of the button
  17. $button-wp-padding-top: 0 !default;
  18. /// @prop - Padding end of the button
  19. $button-wp-padding-end: 1.1em !default;
  20. /// @prop - Padding bottom of the button
  21. $button-wp-padding-bottom: $button-wp-padding-top !default;
  22. /// @prop - Padding start of the button
  23. $button-wp-padding-start: $button-wp-padding-end !default;
  24. /// @prop - Height of the button
  25. $button-wp-height: 3.6rem !default;
  26. /// @prop - Border width of the button
  27. $button-wp-border-width: 3px !default;
  28. /// @prop - Border style of the button
  29. $button-wp-border-style: solid !default;
  30. /// @prop - Border color of the button
  31. $button-wp-border-color: transparent !default;
  32. /// @prop - Border radius of the button
  33. $button-wp-border-radius: 0 !default;
  34. /// @prop - Font size of the button text
  35. $button-wp-font-size: 1.4rem !default;
  36. /// @prop - Background color of the button
  37. $button-wp-background-color: color($colors-wp, primary) !default;
  38. /// @prop - Text color of the button
  39. $button-wp-text-color: color-contrast($colors-wp, $button-wp-background-color) !default;
  40. /// @prop - Background color of the activated button
  41. $button-wp-background-color-activated: color-shade($button-wp-background-color) !default;
  42. // Windows Large Button
  43. // --------------------------------------------------
  44. // deprecated
  45. $button-wp-large-padding: null !default;
  46. /// @prop - Padding top of the large button
  47. $button-wp-large-padding-top: 0 !default;
  48. /// @prop - Padding end of the large button
  49. $button-wp-large-padding-end: 1em !default;
  50. /// @prop - Padding bottom of the large button
  51. $button-wp-large-padding-bottom: $button-wp-large-padding-top !default;
  52. /// @prop - Padding start of the large button
  53. $button-wp-large-padding-start: $button-wp-large-padding-end !default;
  54. /// @prop - Height of the large button
  55. $button-wp-large-height: 2.8em !default;
  56. /// @prop - Font size of the large button
  57. $button-wp-large-font-size: 2rem !default;
  58. // Windows Small Button
  59. // --------------------------------------------------
  60. // deprecated
  61. $button-wp-small-padding: null !default;
  62. /// @prop - Padding top of the small button
  63. $button-wp-small-padding-top: 0 !default;
  64. /// @prop - Padding end of the small button
  65. $button-wp-small-padding-end: .9em !default;
  66. /// @prop - Padding bottom of the small button
  67. $button-wp-small-padding-bottom: $button-wp-small-padding-top !default;
  68. /// @prop - Padding start of the small button
  69. $button-wp-small-padding-start: $button-wp-small-padding-end !default;
  70. /// @prop - Height of the small button
  71. $button-wp-small-height: 2.1em !default;
  72. /// @prop - Font size of the small button
  73. $button-wp-small-font-size: 1.3rem !default;
  74. /// @prop - Font size of an icon in the small button
  75. $button-wp-small-icon-font-size: 1.4em !default;
  76. // Windows Outline Button
  77. // --------------------------------------------------
  78. /// @prop - Border width of the outline button
  79. $button-wp-outline-border-width: 1px !default;
  80. /// @prop - Border style of the outline button
  81. $button-wp-outline-border-style: solid !default;
  82. /// @prop - Border color of the outline button
  83. $button-wp-outline-border-color: $button-wp-background-color !default;
  84. /// @prop - Text color of the outline button
  85. $button-wp-outline-text-color: $button-wp-background-color !default;
  86. /// @prop - Background color of the outline button
  87. $button-wp-outline-background-color: transparent !default;
  88. /// @prop - Background color of the activated outline button
  89. $button-wp-outline-background-color-activated: $button-wp-background-color !default;
  90. /// @prop - Opacity of the background color of the activated outline button
  91. $button-wp-outline-background-color-opacity-activated: .16 !default;
  92. // Windows Clear Button
  93. // --------------------------------------------------
  94. /// @prop - Text color of the clear button
  95. $button-wp-clear-text-color: $button-wp-background-color !default;
  96. /// @prop - Background color of the clear button
  97. $button-wp-clear-background-color: transparent !default;
  98. /// @prop - Background color of the activated clear button
  99. $button-wp-clear-background-color-activated: rgba(158, 158, 158, .2) !default;
  100. /// @prop - Background color of the clear button on hover
  101. $button-wp-clear-background-color-hover: rgba(158, 158, 158, .1) !default;
  102. // Windows Round Button
  103. // --------------------------------------------------
  104. // deprecated
  105. $button-wp-round-padding: null !default;
  106. /// @prop - Padding top of the round button
  107. $button-wp-round-padding-top: $button-round-padding-top !default;
  108. /// @prop - Padding end of the round button
  109. $button-wp-round-padding-end: $button-round-padding-end !default;
  110. /// @prop - Padding bottom of the round button
  111. $button-wp-round-padding-bottom: $button-round-padding-bottom !default;
  112. /// @prop - Padding start of the round button
  113. $button-wp-round-padding-start: $button-round-padding-start !default;
  114. /// @prop - Border radius of the round button
  115. $button-wp-round-border-radius: $button-round-border-radius !default;
  116. // Material Design Decorator Button
  117. // --------------------------------------------------
  118. /// @prop - Font weight of the strong button
  119. $button-wp-strong-font-weight: bold !default;
  120. // Windows Default Button
  121. // --------------------------------------------------
  122. .button-wp {
  123. @include border-radius($button-wp-border-radius);
  124. height: $button-wp-height;
  125. border: $button-wp-border-width $button-wp-border-style $button-wp-border-color;
  126. font-size: $button-wp-font-size;
  127. color: $button-wp-text-color;
  128. background-color: $button-wp-background-color;
  129. @include deprecated-variable(margin, $button-wp-margin) {
  130. @include margin($button-wp-margin-top, $button-wp-margin-end, $button-wp-margin-bottom, $button-wp-margin-start);
  131. }
  132. @include deprecated-variable(padding, $button-wp-padding) {
  133. @include padding($button-wp-padding-top, $button-wp-padding-end, $button-wp-padding-bottom, $button-wp-padding-start);
  134. }
  135. }
  136. .button-wp:hover:not(.disable-hover) {
  137. border-color: $button-wp-background-color-activated;
  138. background-color: $button-wp-background-color;
  139. }
  140. .button-wp.activated {
  141. background-color: $button-wp-background-color-activated;
  142. }
  143. // Windows Default Button Color Mixin
  144. // --------------------------------------------------
  145. @mixin wp-button-default($color-name, $color-base, $color-contrast) {
  146. $bg-color: $color-base;
  147. $bg-color-activated: color-shade($bg-color);
  148. $fg-color: $color-contrast;
  149. .button-wp-#{$color-name} {
  150. color: $fg-color;
  151. background-color: $bg-color;
  152. }
  153. .button-wp-#{$color-name}:hover:not(.disable-hover) {
  154. border-color: $bg-color-activated;
  155. background-color: $bg-color;
  156. }
  157. .button-wp-#{$color-name}.activated {
  158. background-color: $bg-color-activated;
  159. }
  160. }
  161. // Windows Button Sizes
  162. // --------------------------------------------------
  163. .button-large-wp {
  164. height: $button-wp-large-height;
  165. font-size: $button-wp-large-font-size;
  166. @include deprecated-variable(padding, $button-wp-large-padding) {
  167. @include padding($button-wp-large-padding-top, $button-wp-large-padding-end, $button-wp-large-padding-bottom, $button-wp-large-padding-start);
  168. }
  169. }
  170. .button-small-wp {
  171. height: $button-wp-small-height;
  172. font-size: $button-wp-small-font-size;
  173. @include deprecated-variable(padding, $button-wp-small-padding) {
  174. @include padding($button-wp-small-padding-top, $button-wp-small-padding-end, $button-wp-small-padding-bottom, $button-wp-small-padding-start);
  175. }
  176. }
  177. .button-small-wp[icon-only] ion-icon {
  178. font-size: $button-wp-small-icon-font-size;
  179. }
  180. // Windows Block Button
  181. // --------------------------------------------------
  182. .button-block-wp {
  183. @include margin-horizontal(0);
  184. }
  185. // Windows Full Button
  186. // --------------------------------------------------
  187. .button-full-wp {
  188. @include margin-horizontal(0);
  189. @include border-radius(0);
  190. border-right-width: 0;
  191. border-left-width: 0;
  192. }
  193. // Windows Outline Button
  194. // --------------------------------------------------
  195. .button-outline-wp {
  196. border-width: $button-wp-outline-border-width;
  197. border-style: $button-wp-outline-border-style;
  198. border-color: $button-wp-outline-border-color;
  199. color: $button-wp-outline-text-color;
  200. background-color: $button-wp-outline-background-color;
  201. }
  202. .button-outline-wp:hover:not(.disable-hover) {
  203. background-color: $button-wp-clear-background-color-hover;
  204. }
  205. .button-outline-wp.activated {
  206. background-color: rgba($button-wp-outline-background-color-activated, $button-wp-outline-background-color-opacity-activated);
  207. }
  208. // Windows Outline Button Color Mixin
  209. // --------------------------------------------------
  210. @mixin wp-button-outline($color-name, $color-base, $color-contrast) {
  211. $fg-color: color-shade($color-base, 5%);
  212. .button-outline-wp-#{$color-name} {
  213. border-color: $fg-color;
  214. color: $fg-color;
  215. background-color: $button-wp-outline-background-color;
  216. }
  217. .button-outline-wp-#{$color-name}:hover:not(.disable-hover) {
  218. border-color: $fg-color;
  219. background-color: $button-wp-clear-background-color-hover;
  220. }
  221. .button-outline-wp-#{$color-name}.activated {
  222. background-color: rgba($fg-color, $button-wp-outline-background-color-opacity-activated);
  223. }
  224. }
  225. // Windows Clear Button
  226. // --------------------------------------------------
  227. .button-clear-wp {
  228. color: $button-wp-clear-text-color;
  229. background-color: $button-wp-clear-background-color;
  230. }
  231. .button-clear-wp.activated {
  232. background-color: $button-wp-clear-background-color-activated;
  233. }
  234. .button-clear-wp:hover:not(.disable-hover) {
  235. background-color: $button-wp-clear-background-color-hover;
  236. }
  237. // Windows Clear Button Color Mixin
  238. // --------------------------------------------------
  239. @mixin wp-button-clear($color-name, $color-base, $color-contrast) {
  240. $fg-color: $color-base;
  241. .button-clear-wp-#{$color-name} {
  242. color: $fg-color;
  243. background-color: $button-wp-clear-background-color;
  244. }
  245. .button-clear-wp-#{$color-name}.activated {
  246. background-color: $button-wp-clear-background-color-activated;
  247. }
  248. .button-clear-wp-#{$color-name}:hover:not(.disable-hover) {
  249. color: $fg-color;
  250. }
  251. }
  252. // Windows Round Button
  253. // --------------------------------------------------
  254. .button-round-wp {
  255. @include border-radius($button-wp-round-border-radius);
  256. @include deprecated-variable(padding, $button-wp-round-padding) {
  257. @include padding($button-wp-round-padding-top, $button-wp-round-padding-end, $button-wp-round-padding-bottom, $button-wp-round-padding-start);
  258. }
  259. }
  260. .button-wp [icon-only] {
  261. @include padding(0);
  262. }
  263. // Generate Windows Button Colors
  264. // --------------------------------------------------
  265. @each $color-name, $color-base, $color-contrast in get-colors($colors-wp) {
  266. @include wp-button-default($color-name, $color-base, $color-contrast);
  267. @include wp-button-outline($color-name, $color-base, $color-contrast);
  268. @include wp-button-clear($color-name, $color-base, $color-contrast);
  269. }
  270. // WP strong Button
  271. // --------------------------------------------------
  272. .button-strong-wp {
  273. font-weight: $button-wp-strong-font-weight;
  274. }