@import "../../themes/ionic.globals.md"; // Material Design Toolbar // -------------------------------------------------- /// @prop - Order of the toolbar elements $toolbar-order-md: ( back-button: 0, menu-toggle-start: 1, buttons-left: 2, content: 3, buttons-start: 4, buttons-end: 5, buttons-right: 6, menu-toggle-end: 7, ) !default; /// @prop - Font size of the toolbar title $toolbar-md-title-font-size: 2rem !default; /// @prop - Text color of the toolbar title $toolbar-md-title-text-color: color-contrast($colors-md, $toolbar-md-background, md) !default; /// @prop - Font size of the toolbar button $toolbar-md-button-font-size: 1.4rem !default; /// @prop - Text color of the toolbar button $toolbar-md-button-color: $toolbar-md-title-text-color !default; /// @prop - Border radius of the toolbar button $toolbar-md-button-border-radius: 2px !default; /// @prop - Font weight of the strong toolbar button $toolbar-md-button-strong-font-weight: bold !default; /// @prop - Height of the navigation bar $navbar-md-height: $toolbar-md-height !default; $toolbar-button-md-strong-font-weight: bold !default; .toolbar-md { @include padding($toolbar-md-padding); min-height: $toolbar-md-height; } // Material Design Toolbar Background // -------------------------------------------------- .toolbar-background-md { border-color: $toolbar-md-border-color; background: $toolbar-md-background; } // Material Design Header / Footer / Tabs Box Shadow // -------------------------------------------------- .header-md::after, .tabs-md[tabsPlacement="top"] > .tabbar::after, .footer-md::before, .tabs-md[tabsPlacement="bottom"] > .tabbar::before { // using datauri png background image for improved scroll performance // rather than using `box-shadow: 0 2px 5px rgba(0,0,0,0.26);` // noticable performance difference on older Android devices @include position(null, null, -5px, 0); @include background-position(start, 0, top, -2px); position: absolute; width: 100%; height: 5px; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==); background-repeat: repeat-x; content: ""; } .footer-md::before, .tabs-md[tabsPlacement="bottom"] > .tabbar::before { @include position(-2px, null, auto, null); @include background-position(start, 0, top, 0); height: 2px; } .header-md[no-border]::after, .footer-md[no-border]::before, .tabs-md[tabsPlacement="top"][no-border] > .tabbar::after, .tabs-md[tabsPlacement="bottom"][no-border] > .tabbar::before { display: none; } // Material Design Toolbar Content // -------------------------------------------------- .toolbar-content-md { flex: 1; order: map-get($toolbar-order-md, content); min-width: 0; max-width: 100%; } .toolbar-title-md { @include padding(0, 12px); font-size: $toolbar-md-title-font-size; font-weight: 500; color: $toolbar-md-title-text-color; } @mixin md-toolbar-theme($color-name, $color-base, $color-contrast) { .toolbar-md-#{$color-name} { .toolbar-background-md { background: $color-base; } .bar-button-clear-md, .bar-button-default-md, .bar-button-outline-md, .toolbar-title-md { color: $color-contrast; } .bar-button-clear-md, .bar-button-default-md, .bar-button-outline-md { .button-effect { background-color: $color-contrast; } } .bar-button-outline-md { border-color: $color-contrast; } @each $color-name, $color-base, $color-contrast in get-colors($colors-md, md) { @include md-bar-button-default($color-name, $color-base, $color-contrast); @include md-bar-button-outline($color-name, $color-base, $color-contrast); @include md-bar-button-solid($color-name, $color-base, $color-contrast); } } } // Material Design Toolbar Button Placement // -------------------------------------------------- .bar-buttons-md { order: map-get($toolbar-order-md, buttons-start); transform: translateZ(0); } .bar-buttons-md[left] { order: map-get($toolbar-order-md, buttons-left); } .bar-button-md:first-child { @include margin-horizontal(0, null); } .bar-buttons-md[end] { @include text-align(end); order: map-get($toolbar-order-md, buttons-end); } .bar-buttons-md[right] { @include text-align(right); order: map-get($toolbar-order-md, buttons-right); } // Material Design Toolbar Button Default // -------------------------------------------------- .bar-button-md { @include margin(0, .2rem, 0, .2rem); @include padding(0, 5px); @include border-radius($toolbar-md-button-border-radius); height: 32px; border: 0; font-size: $toolbar-md-button-font-size; font-weight: 500; text-transform: uppercase; } .bar-button-solid-md, .bar-button-outline-md { // restrict the ripple to button size overflow: hidden; } @mixin md-bar-button-default($color-name, $color-base, $color-contrast) { .bar-button-#{$color-name}-md, .bar-button-clear-md-#{$color-name}, .bar-button-md-#{$color-name} { color: $color-base; background-color: transparent; &:hover:not(.disable-hover) { color: $color-base; } } } // Material Design Toolbar Button Outline // -------------------------------------------------- .bar-button-outline-md { border-width: 1px; border-style: solid; border-color: $toolbar-md-button-color; color: $toolbar-md-button-color; background-color: transparent; &:hover:not(.disable-hover) { opacity: .4; } &.activated { background-color: transparent; } .button-effect { background-color: $toolbar-md-button-color; } } @mixin md-bar-button-outline($color-name, $color-base, $color-contrast) { .bar-button-outline-md-#{$color-name} { $fg-color: color-shade($color-base); border-color: $fg-color; color: $fg-color; background-color: transparent; &.activated { background-color: transparent; } .button-effect { background-color: $fg-color; } } } // Material Design Toolbar Button Solid // -------------------------------------------------- .bar-button-solid-md { color: color-contrast($colors-md, $toolbar-md-button-color, md); background-color: $toolbar-md-button-color; &:hover:not(.disable-hover) { color: color-contrast($colors-md, $toolbar-md-button-color, md); } &.activated { color: color-contrast($colors-md, $toolbar-md-button-color, md); background-color: color-shade($toolbar-md-button-color); } } @mixin md-bar-button-solid($color-name, $color-base, $color-contrast) { .bar-button-solid-md-#{$color-name} { color: $color-contrast; background-color: $color-base; &.activated { color: $color-contrast; background-color: color-shade($color-base); } } } // Material Design Toolbar Button Icon // -------------------------------------------------- .bar-button-md.bar-button-icon-start ion-icon { @include padding-horizontal(null, .3em); font-size: 1.4em; line-height: .67; pointer-events: none; } .bar-button-md.bar-button-icon-end ion-icon { @include padding-horizontal(.4em, null); font-size: 1.4em; line-height: .67; pointer-events: none; } .bar-button-md[icon-only] { @include padding(0); } .bar-button-md[icon-only] ion-icon { @include padding(0, .1em); min-width: 28px; font-size: 1.8em; line-height: .67; pointer-events: none; } // Material Design Toolbar Back Button // -------------------------------------------------- .back-button-md { @include margin(0, 6px); min-width: 44px; box-shadow: none; } .back-button-icon-md { @include margin(0); @include padding(0, 6px); @include text-align(start); font-size: 2.4rem; font-weight: normal; } // Material Design Toolbar Menu Toggle // -------------------------------------------------- .bar-button-menutoggle-md { @include margin(0, 6px); @include padding(0, 2px); order: map-get($toolbar-order-md, menu-toggle-start); min-width: 44px; } .bar-button-menutoggle-md ion-icon { @include padding(0, 6px); font-size: 2.4rem; } .bar-button-menutoggle-md[end], .bar-button-menutoggle-md[right] { @include margin(0, 2px); order: map-get($toolbar-order-md, menu-toggle-end); min-width: 28px; } // Material Design Toolbar Color Generation // -------------------------------------------------- @include md-bar-button-default(default, $toolbar-md-button-color, color-contrast($colors-md, $toolbar-md-button-color, md)); @include md-bar-button-default(clear, $toolbar-md-button-color, color-contrast($colors-md, $toolbar-md-button-color, md)); @each $color-name, $color-base, $color-contrast in get-colors($colors-md, md) { @include md-toolbar-theme($color-name, $color-base, $color-contrast); @include md-bar-button-default($color-name, $color-base, $color-contrast); @include md-bar-button-outline($color-name, $color-base, $color-contrast); @include md-bar-button-solid($color-name, $color-base, $color-contrast); } // MD strong Button // -------------------------------------------------- .bar-button-strong-md { font-weight: $toolbar-md-button-strong-font-weight; }