toolbar.wp.scss 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. @import "../../themes/ionic.globals.wp";
  2. // Windows Toolbar
  3. // --------------------------------------------------
  4. /// @prop - Order of the toolbar elements
  5. $toolbar-order-wp: (
  6. back-button: 0,
  7. menu-toggle-start: 1,
  8. buttons-left: 2,
  9. content: 3,
  10. buttons-start: 4,
  11. buttons-end: 5,
  12. buttons-right: 6,
  13. menu-toggle-end: 7,
  14. ) !default;
  15. // deprecated
  16. $toolbar-wp-title-padding: null !default;
  17. /// @prop - Padding top of the toolbar title
  18. $toolbar-wp-title-padding-top: 0 !default;
  19. /// @prop - Padding end of the toolbar title
  20. $toolbar-wp-title-padding-end: 6px !default;
  21. /// @prop - Padding bottom of the toolbar title
  22. $toolbar-wp-title-padding-bottom: $toolbar-wp-title-padding-top !default;
  23. /// @prop - Padding start of the toolbar title
  24. $toolbar-wp-title-padding-start: $toolbar-wp-title-padding-end !default;
  25. /// @prop - Font size of the toolbar title
  26. $toolbar-wp-title-font-size: 1.5rem !default;
  27. /// @prop - Font weight of the toolbar title
  28. $toolbar-wp-title-font-weight: bold !default;
  29. /// @prop - Text transform of the toolbar title
  30. $toolbar-wp-title-text-transform: uppercase !default;
  31. /// @prop - Text color of the toolbar title
  32. $toolbar-wp-title-text-color: color-contrast($colors-wp, $toolbar-wp-background, wp) !default;
  33. /// @prop - Font size of the toolbar button
  34. $toolbar-wp-button-font-size: 1.4rem !default;
  35. /// @prop - Text color of the toolbar button
  36. $toolbar-wp-button-color: color-contrast($colors-wp, $toolbar-wp-background, wp) !default;
  37. /// @prop - Border radius of the toolbar button
  38. $toolbar-wp-button-border-radius: 2px !default;
  39. /// @prop - Font weight of the strong toolbar button
  40. $toolbar-wp-button-strong-font-weight: bold !default;
  41. /// @prop - Height of the navigation bar
  42. $navbar-wp-height: $toolbar-wp-height !default;
  43. $toolbar-button-wp-strong-font-weight: bold !default;
  44. .toolbar-wp {
  45. @include padding($toolbar-wp-padding);
  46. min-height: $toolbar-wp-height;
  47. }
  48. // Windows Toolbar Background
  49. // --------------------------------------------------
  50. .toolbar-background-wp {
  51. border-color: $toolbar-wp-border-color;
  52. background: $toolbar-wp-background;
  53. }
  54. // Windows Toolbar Content
  55. // --------------------------------------------------
  56. .toolbar-content-wp {
  57. flex: 1;
  58. order: map-get($toolbar-order-wp, content);
  59. min-width: 0;
  60. max-width: 100%;
  61. }
  62. .toolbar-title-wp {
  63. font-size: $toolbar-wp-title-font-size;
  64. font-weight: $toolbar-wp-title-font-weight;
  65. text-transform: $toolbar-wp-title-text-transform;
  66. color: $toolbar-wp-title-text-color;
  67. @include deprecated-variable(padding, $toolbar-wp-title-padding) {
  68. @include padding($toolbar-wp-title-padding-top, $toolbar-wp-title-padding-end, $toolbar-wp-title-padding-bottom, $toolbar-wp-title-padding-start);
  69. }
  70. }
  71. @mixin wp-toolbar-theme($color-name, $color-base, $color-contrast) {
  72. .toolbar-wp-#{$color-name} .toolbar-background-wp {
  73. background: $color-base;
  74. }
  75. .toolbar-wp-#{$color-name} .bar-button-clear-wp,
  76. .toolbar-wp-#{$color-name} .bar-button-default-wp,
  77. .toolbar-wp-#{$color-name} .bar-button-outline-wp,
  78. .toolbar-wp-#{$color-name} .toolbar-title-wp {
  79. color: $color-contrast;
  80. }
  81. .toolbar-wp-#{$color-name} .bar-button-outline-wp {
  82. border-color: $color-contrast;
  83. }
  84. .toolbar-wp-#{$color-name} {
  85. @each $color-name, $color-base, $color-contrast in get-colors($colors-wp) {
  86. @include wp-bar-button-default($color-name, $color-base, $color-contrast);
  87. @include wp-bar-button-outline($color-name, $color-base, $color-contrast);
  88. @include wp-bar-button-solid($color-name, $color-base, $color-contrast);
  89. }
  90. }
  91. }
  92. // Windows Toolbar Button Placement
  93. // --------------------------------------------------
  94. .bar-buttons-wp {
  95. order: map-get($toolbar-order-wp, buttons-start);
  96. transform: translateZ(0);
  97. }
  98. .bar-buttons-wp[left] {
  99. order: map-get($toolbar-order-wp, buttons-left);
  100. }
  101. .bar-buttons-wp[left] .bar-button:first-child {
  102. @include margin-horizontal(0, null);
  103. }
  104. .bar-buttons-wp[end] {
  105. @include text-align(end);
  106. order: map-get($toolbar-order-wp, buttons-end);
  107. }
  108. .bar-buttons-wp[right] {
  109. @include text-align(right);
  110. order: map-get($toolbar-order-wp, buttons-right);
  111. }
  112. // Windows Toolbar Button Default
  113. // --------------------------------------------------
  114. .bar-button-wp {
  115. @include margin(0, .2rem);
  116. @include padding(0, 5px);
  117. @include border-radius($toolbar-wp-button-border-radius);
  118. height: 32px;
  119. border: 0;
  120. font-size: $toolbar-wp-button-font-size;
  121. font-weight: 500;
  122. text-transform: uppercase;
  123. }
  124. .bar-button-solid-wp,
  125. .bar-button-outline-wp {
  126. // restrict the ripple to button size
  127. overflow: hidden;
  128. }
  129. @mixin wp-bar-button-default($color-name, $color-base, $color-contrast) {
  130. .bar-button-#{$color-name}-wp,
  131. .bar-button-clear-wp-#{$color-name},
  132. .bar-button-wp-#{$color-name} {
  133. color: $color-base;
  134. background-color: transparent;
  135. &:hover:not(.disable-hover) {
  136. color: $color-base;
  137. }
  138. }
  139. }
  140. // Windows Toolbar Button Outline
  141. // --------------------------------------------------
  142. .bar-button-outline-wp {
  143. border-width: 1px;
  144. border-style: solid;
  145. border-color: $toolbar-wp-button-color;
  146. color: $toolbar-wp-button-color;
  147. background-color: transparent;
  148. &:hover:not(.disable-hover) {
  149. opacity: .4;
  150. }
  151. &.activated {
  152. color: color-contrast($colors-wp, $toolbar-wp-button-color, wp);
  153. background-color: $toolbar-wp-button-color;
  154. }
  155. }
  156. @mixin wp-bar-button-outline($color-name, $color-base, $color-contrast) {
  157. .bar-button-outline-wp-#{$color-name} {
  158. $fg-color: color-shade($color-base);
  159. border-color: $fg-color;
  160. color: $fg-color;
  161. background-color: transparent;
  162. &.activated {
  163. color: $color-contrast;
  164. background-color: $fg-color;
  165. }
  166. }
  167. }
  168. // Windows Toolbar Button Solid
  169. // --------------------------------------------------
  170. .bar-button-solid-wp {
  171. color: color-contrast($colors-wp, $toolbar-wp-button-color, wp);
  172. background-color: $toolbar-wp-button-color;
  173. &:hover:not(.disable-hover) {
  174. color: color-contrast($colors-wp, $toolbar-wp-button-color, wp);
  175. }
  176. &.activated {
  177. color: color-contrast($colors-wp, $toolbar-wp-button-color, wp);
  178. background-color: color-shade($toolbar-wp-button-color);
  179. }
  180. }
  181. @mixin wp-bar-button-solid($color-name, $color-base, $color-contrast) {
  182. .bar-button-solid-wp-#{$color-name} {
  183. color: $color-contrast;
  184. background-color: $color-base;
  185. &.activated {
  186. color: $color-contrast;
  187. background-color: color-shade($color-base);
  188. }
  189. }
  190. }
  191. // Windows Toolbar Button Icon
  192. // --------------------------------------------------
  193. .bar-button-wp.bar-button-icon-start ion-icon {
  194. @include padding-horizontal(null, .3em);
  195. font-size: 1.4em;
  196. line-height: .67;
  197. pointer-events: none;
  198. }
  199. .bar-button-wp.bar-button-icon-end ion-icon {
  200. @include padding-horizontal(.4em, null);
  201. font-size: 1.4em;
  202. line-height: .67;
  203. pointer-events: none;
  204. }
  205. .bar-button-wp[icon-only] {
  206. @include padding(0);
  207. ion-icon {
  208. @include padding(0, .1em);
  209. min-width: 28px;
  210. font-size: 1.8em;
  211. line-height: .67;
  212. pointer-events: none;
  213. }
  214. }
  215. // Windows Toolbar Back Button
  216. // --------------------------------------------------
  217. .back-button-wp {
  218. @include margin(0, 6px);
  219. min-width: 44px;
  220. box-shadow: none;
  221. }
  222. .back-button-icon-wp {
  223. @include text-align(start);
  224. @include margin(0);
  225. @include padding(0, 6px);
  226. font-size: 2.4rem;
  227. font-weight: normal;
  228. }
  229. // Windows Toolbar Menu Toggle
  230. // --------------------------------------------------
  231. .bar-button-menutoggle-wp {
  232. @include margin(0, 6px);
  233. @include padding(0, 2px);
  234. order: map-get($toolbar-order-wp, menu-toggle-start);
  235. min-width: 44px;
  236. ion-icon {
  237. @include padding(0, 6px);
  238. font-size: 2.4rem;
  239. }
  240. }
  241. .bar-button-menutoggle-wp[end],
  242. .bar-button-menutoggle-wp[right] {
  243. @include margin(0, 2px);
  244. order: map-get($toolbar-order-wp, menu-toggle-end);
  245. min-width: 28px;
  246. }
  247. // Windows Toolbar Color Generation
  248. // --------------------------------------------------
  249. @include wp-bar-button-default(default, $toolbar-wp-button-color, color-contrast($colors-wp, $toolbar-wp-button-color, wp));
  250. @include wp-bar-button-default(clear, $toolbar-wp-button-color, color-contrast($colors-wp, $toolbar-wp-button-color, wp));
  251. @each $color-name, $color-base, $color-contrast in get-colors($colors-wp) {
  252. @include wp-toolbar-theme($color-name, $color-base, $color-contrast);
  253. @include wp-bar-button-default($color-name, $color-base, $color-contrast);
  254. @include wp-bar-button-outline($color-name, $color-base, $color-contrast);
  255. @include wp-bar-button-solid($color-name, $color-base, $color-contrast);
  256. }
  257. // WP strong Button
  258. // --------------------------------------------------
  259. .bar-button-strong-wp {
  260. font-weight: $toolbar-wp-button-strong-font-weight;
  261. }