_bar.scss 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. /**
  2. * Bar (Headers and Footers)
  3. * --------------------------------------------------
  4. */
  5. .bar {
  6. @include display-flex();
  7. @include translate3d(0,0,0);
  8. @include user-select(none);
  9. position: absolute;
  10. right: 0;
  11. left: 0;
  12. z-index: $z-index-bar;
  13. @include box-sizing(border-box);
  14. padding: $bar-padding-portrait;
  15. width: 100%;
  16. height: $bar-height;
  17. border-width: 0;
  18. border-style: solid;
  19. border-top: 1px solid transparent;
  20. border-bottom: 1px solid $bar-default-border;
  21. background-color: $bar-default-bg;
  22. /* border-width: 1px will actually create 2 device pixels on retina */
  23. /* this nifty trick sets an actual 1px border on hi-res displays */
  24. background-size: 0;
  25. @media (min--moz-device-pixel-ratio: 1.5),
  26. (-webkit-min-device-pixel-ratio: 1.5),
  27. (min-device-pixel-ratio: 1.5),
  28. (min-resolution: 144dpi),
  29. (min-resolution: 1.5dppx) {
  30. border: none;
  31. background-image: linear-gradient(0deg, $bar-default-border, $bar-default-border 50%, transparent 50%);
  32. background-position: bottom;
  33. background-size: 100% 1px;
  34. background-repeat: no-repeat;
  35. }
  36. &.bar-clear {
  37. border: none;
  38. background: none;
  39. color: #fff;
  40. .button {
  41. color: #fff;
  42. }
  43. .title {
  44. color: #fff;
  45. }
  46. }
  47. &.item-input-inset {
  48. .item-input-wrapper {
  49. margin-top: -1px;
  50. input {
  51. padding-left: 8px;
  52. width: 94%;
  53. height: 28px;
  54. background: transparent;
  55. }
  56. }
  57. }
  58. &.bar-light {
  59. @include bar-style($bar-light-bg, $bar-light-border, $bar-light-text);
  60. &.bar-footer{
  61. background-image: linear-gradient(180deg, $bar-light-border, $bar-light-border 50%, transparent 50%);
  62. }
  63. }
  64. &.bar-stable {
  65. @include bar-style($bar-stable-bg, $bar-stable-border, $bar-stable-text);
  66. &.bar-footer{
  67. background-image: linear-gradient(180deg, $bar-stable-border, $bar-stable-border 50%, transparent 50%);
  68. }
  69. }
  70. &.bar-positive {
  71. @include bar-style($bar-positive-bg, $bar-positive-border, $bar-positive-text);
  72. &.bar-footer{
  73. background-image: linear-gradient(180deg, $bar-positive-border, $bar-positive-border 50%, transparent 50%);
  74. }
  75. }
  76. &.bar-calm {
  77. @include bar-style($bar-calm-bg, $bar-calm-border, $bar-calm-text);
  78. &.bar-footer{
  79. background-image: linear-gradient(180deg, $bar-calm-border, $bar-calm-border 50%, transparent 50%);
  80. }
  81. }
  82. &.bar-assertive {
  83. @include bar-style($bar-assertive-bg, $bar-assertive-border, $bar-assertive-text);
  84. &.bar-footer{
  85. background-image: linear-gradient(180deg, $bar-assertive-border, $bar-assertive-border 50%, transparent 50%);
  86. }
  87. }
  88. &.bar-balanced {
  89. @include bar-style($bar-balanced-bg, $bar-balanced-border, $bar-balanced-text);
  90. &.bar-footer{
  91. background-image: linear-gradient(180deg, $bar-balanced-border, $bar-balanced-border 50%, transparent 50%);
  92. }
  93. }
  94. &.bar-energized {
  95. @include bar-style($bar-energized-bg, $bar-energized-border, $bar-energized-text);
  96. &.bar-footer{
  97. background-image: linear-gradient(180deg, $bar-energized-border, $bar-energized-border 50%, transparent 50%);
  98. }
  99. }
  100. &.bar-royal {
  101. @include bar-style($bar-royal-bg, $bar-royal-border, $bar-royal-text);
  102. &.bar-footer{
  103. background-image: linear-gradient(180deg, $bar-royal-border, $bar-royal-border 50%, transparent 50%);
  104. }
  105. }
  106. &.bar-dark {
  107. @include bar-style($bar-dark-bg, $bar-dark-border, $bar-dark-text);
  108. &.bar-footer{
  109. background-image: linear-gradient(180deg, $bar-dark-border, $bar-dark-border 50%, transparent 50%);
  110. }
  111. }
  112. // Title inside of a bar is centered
  113. .title {
  114. display: block;
  115. position: absolute;
  116. top: 0;
  117. right: 0;
  118. left: 0;
  119. z-index: $z-index-bar-title;
  120. overflow: hidden;
  121. margin: 0 10px;
  122. min-width: 30px;
  123. height: $bar-height - 1;
  124. text-align: center;
  125. // Go into ellipsis if too small
  126. text-overflow: ellipsis;
  127. white-space: nowrap;
  128. font-size: $bar-title-font-size;
  129. font-weight: $headings-font-weight;
  130. line-height: $bar-height;
  131. &.title-left {
  132. text-align: left;
  133. }
  134. &.title-right {
  135. text-align: right;
  136. }
  137. }
  138. .title a {
  139. color: inherit;
  140. }
  141. .button, button {
  142. z-index: $z-index-bar-button;
  143. padding: 0 $button-bar-button-padding;
  144. min-width: initial;
  145. min-height: $button-bar-button-height - 1;
  146. font-weight: 400;
  147. font-size: $button-bar-button-font-size;
  148. line-height: $button-bar-button-height;
  149. &.button-icon:before,
  150. .icon:before,
  151. &.icon:before,
  152. &.icon-left:before,
  153. &.icon-right:before {
  154. padding-right: 2px;
  155. padding-left: 2px;
  156. font-size: $button-bar-button-icon-size;
  157. line-height: $button-bar-button-height;
  158. }
  159. &.button-icon {
  160. font-size: $bar-title-font-size;
  161. .icon:before,
  162. &:before,
  163. &.icon-left:before,
  164. &.icon-right:before {
  165. vertical-align: top;
  166. font-size: $button-large-icon-size;
  167. line-height: $button-bar-button-height;
  168. }
  169. }
  170. &.button-clear {
  171. padding-right: 2px;
  172. padding-left: 2px;
  173. font-weight: 300;
  174. font-size: $bar-title-font-size;
  175. .icon:before,
  176. &.icon:before,
  177. &.icon-left:before,
  178. &.icon-right:before {
  179. font-size: $button-large-icon-size;
  180. line-height: $button-bar-button-height;
  181. }
  182. }
  183. &.back-button {
  184. display: block;
  185. margin-right: 5px;
  186. padding: 0;
  187. white-space: nowrap;
  188. font-weight: 400;
  189. }
  190. &.back-button.active,
  191. &.back-button.activated {
  192. opacity: 0.2;
  193. }
  194. }
  195. .button-bar > .button,
  196. .buttons > .button {
  197. min-height: $button-bar-button-height - 1;
  198. line-height: $button-bar-button-height;
  199. }
  200. .button-bar + .button,
  201. .button + .button-bar {
  202. margin-left: 5px;
  203. }
  204. // Android 4.4 messes with the display property
  205. .buttons,
  206. .buttons.primary-buttons,
  207. .buttons.secondary-buttons {
  208. display: inherit;
  209. }
  210. .buttons span {
  211. display: inline-block;
  212. }
  213. .buttons-left span {
  214. margin-right: 5px;
  215. display: inherit;
  216. }
  217. .buttons-right span {
  218. margin-left: 5px;
  219. display: inherit;
  220. }
  221. // Place the last button in a bar on the right of the bar
  222. .title + .button:last-child,
  223. > .button + .button:last-child,
  224. > .button.pull-right,
  225. .buttons.pull-right,
  226. .title + .buttons {
  227. position: absolute;
  228. top: 5px;
  229. right: 5px;
  230. bottom: 5px;
  231. }
  232. }
  233. .platform-android {
  234. .nav-bar-has-subheader .bar {
  235. background-image: none;
  236. }
  237. .bar {
  238. .back-button .icon:before {
  239. font-size: 24px;
  240. }
  241. .title {
  242. font-size: 19px;
  243. line-height: $bar-height;
  244. }
  245. }
  246. }
  247. // Default styles for buttons inside of styled bars
  248. .bar-light {
  249. .button {
  250. @include button-style($bar-light-bg, $bar-light-border, $bar-light-active-bg, $bar-light-active-border, $bar-light-text);
  251. @include button-clear($bar-light-text, $bar-title-font-size);
  252. }
  253. }
  254. .bar-stable {
  255. .button {
  256. @include button-style($bar-stable-bg, $bar-stable-border, $bar-stable-active-bg, $bar-stable-active-border, $bar-stable-text);
  257. @include button-clear($bar-stable-text, $bar-title-font-size);
  258. }
  259. }
  260. .bar-positive {
  261. .button {
  262. @include button-style($bar-positive-bg, $bar-positive-border, $bar-positive-active-bg, $bar-positive-active-border, $bar-positive-text);
  263. @include button-clear(#fff, $bar-title-font-size);
  264. }
  265. }
  266. .bar-calm {
  267. .button {
  268. @include button-style($bar-calm-bg, $bar-calm-border, $bar-calm-active-bg, $bar-calm-active-border, $bar-calm-text);
  269. @include button-clear(#fff, $bar-title-font-size);
  270. }
  271. }
  272. .bar-assertive {
  273. .button {
  274. @include button-style($bar-assertive-bg, $bar-assertive-border, $bar-assertive-active-bg, $bar-assertive-active-border, $bar-assertive-text);
  275. @include button-clear(#fff, $bar-title-font-size);
  276. }
  277. }
  278. .bar-balanced {
  279. .button {
  280. @include button-style($bar-balanced-bg, $bar-balanced-border, $bar-balanced-active-bg, $bar-balanced-active-border, $bar-balanced-text);
  281. @include button-clear(#fff, $bar-title-font-size);
  282. }
  283. }
  284. .bar-energized {
  285. .button {
  286. @include button-style($bar-energized-bg, $bar-energized-border, $bar-energized-active-bg, $bar-energized-active-border, $bar-energized-text);
  287. @include button-clear(#fff, $bar-title-font-size);
  288. }
  289. }
  290. .bar-royal {
  291. .button {
  292. @include button-style($bar-royal-bg, $bar-royal-border, $bar-royal-active-bg, $bar-royal-active-border, $bar-royal-text);
  293. @include button-clear(#fff, $bar-title-font-size);
  294. }
  295. }
  296. .bar-dark {
  297. .button {
  298. @include button-style($bar-dark-bg, $bar-dark-border, $bar-dark-active-bg, $bar-dark-active-border, $bar-dark-text);
  299. @include button-clear(#fff, $bar-title-font-size);
  300. }
  301. }
  302. // Header at top
  303. .bar-header {
  304. top: 0;
  305. border-top-width: 0;
  306. border-bottom-width: 1px;
  307. &.has-tabs-top{
  308. border-bottom-width: 0px;
  309. background-image: none;
  310. }
  311. }
  312. .tabs-top .bar-header{
  313. border-bottom-width: 0px;
  314. background-image: none;
  315. }
  316. // Footer at bottom
  317. .bar-footer {
  318. bottom: 0;
  319. border-top-width: 1px;
  320. border-bottom-width: 0;
  321. background-position: top;
  322. height: $bar-footer-height;
  323. &.item-input-inset {
  324. position: absolute;
  325. }
  326. .title {
  327. height: $bar-footer-height - 1;
  328. line-height: $bar-footer-height;
  329. }
  330. }
  331. // Don't render padding if the bar is just for tabs
  332. .bar-tabs {
  333. padding: 0;
  334. }
  335. .bar-subheader {
  336. top: $bar-height;
  337. height: $bar-subheader-height;
  338. .title {
  339. height: $bar-subheader-height - 1;
  340. line-height: $bar-subheader-height;
  341. }
  342. }
  343. .bar-subfooter {
  344. bottom: $bar-footer-height;
  345. height: $bar-subfooter-height;
  346. .title {
  347. height: $bar-subfooter-height - 1;
  348. line-height: $bar-subfooter-height;
  349. }
  350. }
  351. .nav-bar-block {
  352. position: absolute;
  353. top: 0;
  354. right: 0;
  355. left: 0;
  356. z-index: $z-index-bar;
  357. }
  358. .bar .back-button.hide,
  359. .bar .buttons .hide {
  360. display: none;
  361. }
  362. .nav-bar-tabs-top .bar {
  363. background-image: none;
  364. }