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