123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. @import "../../themes/ionic.globals.md";
  2. // Material Design Tabs
  3. // --------------------------------------------------
  4. // deprecated
  5. $tabs-md-tab-padding: null !default;
  6. /// @prop - Padding top on the tab button
  7. $tabs-md-tab-padding-top: 0 !default;
  8. /// @prop - Padding end on the tab button
  9. $tabs-md-tab-padding-end: $tabs-md-tab-padding-top !default;
  10. /// @prop - Padding bottom on the tab button
  11. $tabs-md-tab-padding-bottom: $tabs-md-tab-padding-top !default;
  12. /// @prop - Padding start on the tab button
  13. $tabs-md-tab-padding-start: $tabs-md-tab-padding-end !default;
  14. /// @prop - Minimum height of the tab button
  15. $tabs-md-tab-min-height: 5.6rem !default;
  16. /// @prop - Font size of the inactive tab button text
  17. $tabs-md-tab-font-size: 1.2rem !default;
  18. /// @prop - Font weight of the tab button text
  19. $tabs-md-tab-font-weight: normal !default;
  20. /// @prop - Opacity of the inactive tab button
  21. $tabs-md-tab-opacity: .7 !default;
  22. /// @prop - Text color of the inactive tab button
  23. $tabs-md-tab-text-color: rgba($tabs-md-tab-color-inactive, $tabs-md-tab-opacity) !default;
  24. /// @prop - Text color of the active tab button
  25. $tabs-md-tab-text-color-active: $tabs-md-tab-color-active !default;
  26. /// @prop - Icon color of the inactive tab button
  27. $tabs-md-tab-icon-color: rgba($tabs-md-tab-color-inactive, $tabs-md-tab-opacity) !default;
  28. /// @prop - Icon color of the active tab button
  29. $tabs-md-tab-icon-color-active: $tabs-md-tab-color-active !default;
  30. // deprecated
  31. $tabs-md-tab-padding-active: null !default;
  32. /// @prop - Padding top of the active tab button
  33. $tabs-md-tab-padding-active-top: 0 !default;
  34. /// @prop - Padding end of the active tab button
  35. $tabs-md-tab-padding-active-end: $tabs-md-tab-padding-active-top !default;
  36. /// @prop - Padding bottom of the active tab button
  37. $tabs-md-tab-padding-active-bottom: $tabs-md-tab-padding-active-top !default;
  38. /// @prop - Padding start of the active tab button
  39. $tabs-md-tab-padding-active-start: $tabs-md-tab-padding-active-end !default;
  40. /// @prop - Font size of the active tab button text
  41. $tabs-md-tab-font-size-active: 1.4rem !default;
  42. // deprecated
  43. $tabs-md-tab-text-margin: null !default;
  44. /// @prop - Margin top on the tab button text
  45. $tabs-md-tab-text-margin-top: 0 !default;
  46. /// @prop - Margin end on the tab button text
  47. $tabs-md-tab-text-margin-end: $tabs-md-tab-text-margin-top !default;
  48. /// @prop - Margin bottom on the tab button text
  49. $tabs-md-tab-text-margin-bottom: $tabs-md-tab-text-margin-top !default;
  50. /// @prop - Margin start on the tab button text
  51. $tabs-md-tab-text-margin-start: $tabs-md-tab-text-margin-end !default;
  52. /// @prop - Capitalization of the tab button text
  53. $tabs-md-tab-text-capitalization: none !default;
  54. // deprecated
  55. $tabs-md-tab-text-transform-origin: null !default;
  56. /// @prop - Transform origin x for the tab button text
  57. $tabs-md-tab-text-transform-origin-x: 50% !default;
  58. /// @prop - Transform origin y for the tab button text
  59. $tabs-md-tab-text-transform-origin-y: 80% !default;
  60. /// @prop - Transform for the active tab button text
  61. $tabs-md-tab-text-transform-active: scale3d($tabs-md-tab-font-size-active / $tabs-md-tab-font-size, $tabs-md-tab-font-size-active / $tabs-md-tab-font-size, 1) !default;
  62. /// @prop - Text transition for the tab button text
  63. $tabs-md-tab-text-transition: transform .3s ease-in-out !default;
  64. // deprecated
  65. $tabs-md-tab-icon-transform-active: null !default;
  66. /// @prop - Transform x for the active tab button icon when the layout is icon-top, icon-only, or title-only
  67. $tabs-md-tab-icon-transform-x-active: 0 !default;
  68. /// @prop - Transform y for the active tab button icon when the layout is icon-top, icon-only, or title-only
  69. $tabs-md-tab-icon-transform-y-active: -2px !default;
  70. /// @prop - Transform z for the active tab button icon when the layout is icon-top, icon-only, or title-only
  71. $tabs-md-tab-icon-transform-z-active: 0 !default;
  72. // deprecated
  73. $tabs-md-tab-icon-end-transform-active: null !default;
  74. /// @prop - Transform x for the active tab button icon when the layout is icon-right
  75. $tabs-md-tab-icon-right-transform-x-active: 2px !default;
  76. /// @prop - Transform y for the active tab button icon when the layout is icon-right
  77. $tabs-md-tab-icon-right-transform-y-active: 0 !default;
  78. /// @prop - Transform z for the active tab button icon when the layout is icon-right
  79. $tabs-md-tab-icon-right-transform-z-active: 0 !default;
  80. // deprecated
  81. $tabs-md-tab-icon-bottom-transform-active: null !default;
  82. /// @prop - Transform x for the active tab button icon when the layout is icon-bottom
  83. $tabs-md-tab-icon-bottom-transform-x-active: 0 !default;
  84. /// @prop - Transform y for the active tab button icon when the layout is icon-bottom
  85. $tabs-md-tab-icon-bottom-transform-y-active: 2px !default;
  86. /// @prop - Transform z for the active tab button icon when the layout is icon-bottom
  87. $tabs-md-tab-icon-bottom-transform-z-active: 0 !default;
  88. // deprecated
  89. $tabs-md-tab-icon-start-transform-active: null !default;
  90. /// @prop - Transform x for the active tab button icon when the layout is icon-left
  91. $tabs-md-tab-icon-left-transform-x-active: -2px !default;
  92. /// @prop - Transform y for the active tab button icon when the layout is icon-left
  93. $tabs-md-tab-icon-left-transform-y-active: 0 !default;
  94. /// @prop - Transform z for the active tab button icon when the layout is icon-left
  95. $tabs-md-tab-icon-left-transform-z-active: 0 !default;
  96. // deprecated
  97. $tabs-md-tab-icon-transform-origin: null !default;
  98. /// @prop - Transform origin x for the tab button text
  99. $tabs-md-tab-icon-transform-origin-x: 50% !default;
  100. /// @prop - Transform origin y for the tab button text
  101. $tabs-md-tab-icon-transform-origin-y: 150% !default;
  102. /// @prop - Text transition for the tab button icon
  103. $tabs-md-tab-icon-transition: transform .3s ease-in-out !default;
  104. /// @prop - Size of the tab button icon
  105. $tabs-md-tab-icon-size: 2.4rem !default;
  106. .tabs-md .tabbar {
  107. background: $tabs-md-background;
  108. }
  109. // Material Design Tab Button
  110. // --------------------------------------------------
  111. .tabs-md .tab-button {
  112. min-height: $tabs-md-tab-min-height;
  113. font-weight: $tabs-md-tab-font-weight;
  114. color: $tabs-md-tab-text-color;
  115. @include deprecated-variable(padding, $tabs-md-tab-padding) {
  116. @include padding($tabs-md-tab-padding-top, $tabs-md-tab-padding-end, $tabs-md-tab-padding-bottom, $tabs-md-tab-padding-start);
  117. }
  118. }
  119. .tabs-md .tab-button[aria-selected=true] {
  120. color: $tabs-md-tab-text-color-active;
  121. @include deprecated-variable(padding, $tabs-md-tab-padding-active) {
  122. @include padding($tabs-md-tab-padding-active-top, $tabs-md-tab-padding-active-end, $tabs-md-tab-padding-active-bottom, $tabs-md-tab-padding-active-start);
  123. }
  124. }
  125. // Material Design Tab Button Text
  126. // --------------------------------------------------
  127. .tabs-md .tab-button-text {
  128. font-size: $tabs-md-tab-font-size;
  129. text-transform: $tabs-md-tab-text-capitalization;
  130. transition: $tabs-md-tab-text-transition;
  131. @include deprecated-variable(margin, $tabs-md-tab-text-margin) {
  132. @include margin($tabs-md-tab-text-margin-top, $tabs-md-tab-text-margin-end, $tabs-md-tab-text-margin-bottom, $tabs-md-tab-text-margin-start);
  133. }
  134. @include deprecated-variable(transform-origin, $tabs-md-tab-text-transform-origin) {
  135. @include transform-origin($tabs-md-tab-text-transform-origin-x, $tabs-md-tab-text-transform-origin-y);
  136. }
  137. }
  138. .tabs-md .tab-button[aria-selected=true] .tab-button-text {
  139. transform: $tabs-md-tab-text-transform-active;
  140. transition: $tabs-md-tab-text-transition;
  141. }
  142. .tabs-md[tabsLayout=icon-top] .has-icon .tab-button-text {
  143. @include margin(4px, null, 0, null);
  144. }
  145. .tabs-md[tabsLayout=icon-bottom] .tab-button .tab-button-text {
  146. @include margin(0, null, null, null);
  147. }
  148. // Material Design Tab Button Icon
  149. // --------------------------------------------------
  150. .tabs-md .tab-button-icon {
  151. @include margin(1px, null, null, null);
  152. min-width: $tabs-md-tab-icon-size;
  153. font-size: $tabs-md-tab-icon-size;
  154. color: $tabs-md-tab-icon-color;
  155. transition: $tabs-md-tab-icon-transition;
  156. @include deprecated-variable(transform-origin, $tabs-md-tab-icon-transform-origin) {
  157. @include transform-origin($tabs-md-tab-icon-transform-origin-x, $tabs-md-tab-icon-transform-origin-y);
  158. }
  159. }
  160. // Tab layout: icon-top, icon-only, title-only
  161. .tabs-md .tab-button[aria-selected=true] .tab-button-icon {
  162. color: $tabs-md-tab-icon-color-active;
  163. @include deprecated-variable(transform, $tabs-md-tab-icon-transform-active) {
  164. @include transform(translate3d($tabs-md-tab-icon-transform-x-active, $tabs-md-tab-icon-transform-y-active, $tabs-md-tab-icon-transform-z-active));
  165. }
  166. }
  167. // Tab layout: icon-end
  168. .tabs-md[tabsLayout=icon-right] .tab-button[aria-selected=true] .tab-button-icon, // deprecated
  169. .tabs-md[tabsLayout=icon-end] .tab-button[aria-selected=true] .tab-button-icon {
  170. @include deprecated-variable(transform, $tabs-md-tab-icon-end-transform-active) {
  171. @include transform(translate3d($tabs-md-tab-icon-right-transform-x-active, $tabs-md-tab-icon-right-transform-y-active, $tabs-md-tab-icon-right-transform-z-active));
  172. }
  173. }
  174. // Tab layout: icon-bottom
  175. .tabs-md[tabsLayout=icon-bottom] .tab-button[aria-selected=true] .tab-button-icon {
  176. @include deprecated-variable(transform, $tabs-md-tab-icon-bottom-transform-active) {
  177. @include transform(translate3d($tabs-md-tab-icon-bottom-transform-x-active, $tabs-md-tab-icon-bottom-transform-y-active, $tabs-md-tab-icon-bottom-transform-z-active));
  178. }
  179. }
  180. // Tab layout: icon-start
  181. .tabs-md[tabsLayout=icon-left] .tab-button[aria-selected=true] .tab-button-icon, // deprecated
  182. .tabs-md[tabsLayout=icon-start] .tab-button[aria-selected=true] .tab-button-icon {
  183. @include deprecated-variable(transform, $tabs-md-tab-icon-start-transform-active) {
  184. @include transform(translate3d($tabs-md-tab-icon-left-transform-x-active, $tabs-md-tab-icon-left-transform-y-active, $tabs-md-tab-icon-left-transform-z-active));
  185. }
  186. }
  187. // Material Design Tab with Icon or Title only
  188. // --------------------------------------------------
  189. .tabs-md[tabsLayout=icon-hide] .tab-button,
  190. .tabs-md[tabsLayout=title-hide] .tab-button,
  191. .tabs-md .tab-button.icon-only,
  192. .tabs-md .tab-button.has-title-only {
  193. @include padding(0, 10px);
  194. }
  195. // Material Design Tab Highlight
  196. // --------------------------------------------------
  197. .tabs-md[tabsHighlight=true] .tab-highlight {
  198. @include position(null, null, 0, 0);
  199. @include transform-origin(0, 0);
  200. position: absolute;
  201. display: block;
  202. width: 1px;
  203. height: 2px;
  204. background: $tabs-md-tab-color-active;
  205. transform: translateZ(0);
  206. }
  207. .tabs-md[tabsHighlight=true] .tab-highlight.animate {
  208. transition-duration: 300ms;
  209. }
  210. .tabs-md[tabsHighlight=true][tabsPlacement=bottom] > .tabbar > .tab-highlight {
  211. top: 0;
  212. }
  213. // Material Design Tabs Color Mixin
  214. // --------------------------------------------------
  215. @mixin tabbar-md($color-name, $color-base, $color-contrast) {
  216. .tabs-md-#{$color-name} .tabbar {
  217. background-color: $color-base;
  218. }
  219. .tabs-md-#{$color-name} .tab-button,
  220. .tabs-md-#{$color-name} .tab-button-icon {
  221. color: rgba($color-contrast, $tabs-md-tab-opacity);
  222. }
  223. .tabs-md-#{$color-name} .tab-button:hover:not(.disable-hover),
  224. .tabs-md-#{$color-name} .tab-button[aria-selected=true],
  225. .tabs-md-#{$color-name} .tab-button[aria-selected=true] .tab-button-icon {
  226. color: $color-contrast;
  227. }
  228. .tabs-md-#{$color-name}[tabsHighlight=true] .tab-highlight {
  229. background: $color-contrast;
  230. }
  231. }
  232. // Material Design Tabbar Color Generation
  233. // --------------------------------------------------
  234. @each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
  235. @include tabbar-md($color-name, $color-base, $color-contrast);
  236. }