mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
292 lines
5.8 KiB
SCSS
292 lines
5.8 KiB
SCSS
@import "../../../globals.md";
|
|
@import "../toolbar";
|
|
@import "../toolbar-button";
|
|
|
|
// Material Design Toolbar
|
|
// --------------------------------------------------
|
|
|
|
$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,
|
|
);
|
|
|
|
$toolbar-md-padding: 4px !default;
|
|
$toolbar-md-height: 5.6rem !default;
|
|
$toolbar-md-title-font-size: 2rem !default;
|
|
$toolbar-md-button-font-size: 1.4rem !default;
|
|
$navbar-md-height: $toolbar-md-height !default;
|
|
|
|
$bar-button-md-color: $toolbar-md-active-color !default;
|
|
$bar-button-md-border-radius: 2px !default;
|
|
|
|
|
|
.toolbar {
|
|
padding: $toolbar-md-padding;
|
|
min-height: $toolbar-md-height;
|
|
}
|
|
|
|
ion-navbar-section {
|
|
min-height: $navbar-md-height;
|
|
}
|
|
|
|
|
|
// Material Design Toolbar Background
|
|
// --------------------------------------------------
|
|
|
|
.toolbar-background {
|
|
border-color: $toolbar-md-border-color;
|
|
background-color: $toolbar-md-background-color;
|
|
}
|
|
|
|
|
|
// Material Design Toolbar Content
|
|
// --------------------------------------------------
|
|
|
|
.toolbar-content {
|
|
flex: 1;
|
|
order: map-get($toolbar-order-md, content);
|
|
}
|
|
|
|
.toolbar-title {
|
|
color: $toolbar-md-text-color;
|
|
}
|
|
|
|
ion-title {
|
|
padding: 0 12px;
|
|
font-size: $toolbar-md-title-font-size;
|
|
font-weight: 500;
|
|
}
|
|
|
|
@mixin md-toolbar-theme($color-name, $color-value) {
|
|
.toolbar[#{$color-name}] {
|
|
|
|
.toolbar-background {
|
|
background-color: $color-value;
|
|
}
|
|
|
|
.toolbar-title {
|
|
color: inverse($color-value);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// Material Design Toolbar Button Placement
|
|
// --------------------------------------------------
|
|
|
|
ion-buttons {
|
|
order: map-get($toolbar-order-md, buttons-start);
|
|
transform: translateZ(0px);
|
|
}
|
|
|
|
ion-buttons[left] {
|
|
order: map-get($toolbar-order-md, buttons-left);
|
|
}
|
|
|
|
ion-buttons[left] .bar-button:first-child {
|
|
margin-left: 0;
|
|
}
|
|
|
|
ion-buttons[end] {
|
|
text-align: right;
|
|
order: map-get($toolbar-order-md, buttons-end);
|
|
}
|
|
|
|
ion-buttons[right] {
|
|
text-align: right;
|
|
order: map-get($toolbar-order-md, buttons-right);
|
|
}
|
|
|
|
|
|
// Material Design Toolbar Button Default
|
|
// --------------------------------------------------
|
|
|
|
.bar-button {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
padding: 0 5px;
|
|
min-height: 32px;
|
|
border: 0;
|
|
font-size: $toolbar-md-button-font-size;
|
|
border-radius: $bar-button-md-border-radius;
|
|
}
|
|
|
|
@mixin md-bar-button-default($color-name, $color-value) {
|
|
|
|
.bar-button-#{$color-name} {
|
|
$fg-color: color-shade($color-value);
|
|
color: $fg-color;
|
|
background-color: transparent;
|
|
|
|
&:hover:not(.disable-hover) {
|
|
color: color-shade($fg-color);
|
|
}
|
|
|
|
&.activated {
|
|
opacity: 0.4;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// Material Design Toolbar Button Outline
|
|
// --------------------------------------------------
|
|
|
|
.bar-button-outline {
|
|
border-width: 1px;
|
|
border-style: solid;
|
|
border-color: $bar-button-md-color;
|
|
color: $bar-button-md-color;
|
|
background-color: transparent;
|
|
|
|
&:hover:not(.disable-hover) {
|
|
opacity: 0.4;
|
|
}
|
|
|
|
&.activated {
|
|
color: inverse($bar-button-md-color);
|
|
background-color: $bar-button-md-color;
|
|
}
|
|
}
|
|
|
|
@mixin md-bar-button-outline($color-name, $color-value) {
|
|
|
|
.bar-button-outline-#{$color-name} {
|
|
$fg-color: color-shade($color-value);
|
|
border-color: $fg-color;
|
|
color: $fg-color;
|
|
background-color: transparent;
|
|
|
|
&.activated {
|
|
color: inverse($fg-color);
|
|
background-color: $fg-color;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// Material Design Toolbar Button Solid
|
|
// --------------------------------------------------
|
|
|
|
.bar-button-solid {
|
|
color: inverse($bar-button-md-color);
|
|
background-color: $bar-button-md-color;
|
|
|
|
&:hover:not(.disable-hover) {
|
|
opacity: 0.4;
|
|
color: inverse($bar-button-md-color);
|
|
}
|
|
|
|
&.activated {
|
|
opacity: 0.4;
|
|
color: inverse($bar-button-md-color);
|
|
background-color: color-shade($bar-button-md-color);
|
|
}
|
|
}
|
|
|
|
@mixin md-bar-button-solid($color-name, $color-value) {
|
|
|
|
.bar-button-solid-#{$color-name} {
|
|
color: inverse($color-value);
|
|
background-color: $color-value;
|
|
|
|
&.activated {
|
|
background-color: color-shade($color-value);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// Material Design Toolbar Button Icon
|
|
// --------------------------------------------------
|
|
|
|
.bar-button-icon-left icon {
|
|
margin-left: -0.1em;
|
|
padding-right: 0.3em;
|
|
font-size: 1.4em;
|
|
line-height: 0.67;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.bar-button-icon-right icon {
|
|
margin-right: -0.2em;
|
|
padding-left: 0.4em;
|
|
font-size: 1.4em;
|
|
line-height: 0.67;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.bar-button-icon-only {
|
|
padding: 0;
|
|
min-width: 0.9em;
|
|
|
|
icon {
|
|
padding: 0 0.1em;
|
|
font-size: 1.8em;
|
|
line-height: 0.67;
|
|
pointer-events: none;
|
|
}
|
|
}
|
|
|
|
|
|
// Material Design Toolbar Back Button
|
|
// --------------------------------------------------
|
|
|
|
.back-button {
|
|
margin: 0 0 0 12px;
|
|
box-shadow: none;
|
|
}
|
|
|
|
.back-button-icon {
|
|
margin: 0;
|
|
min-width: 44px;
|
|
font-size: 2.4rem;
|
|
font-weight: normal;
|
|
text-align: left;
|
|
}
|
|
|
|
|
|
// Material Design Toolbar Menu Toggle
|
|
// --------------------------------------------------
|
|
|
|
.bar-button-menu-toggle {
|
|
margin: 0 6px;
|
|
padding: 0 2px;
|
|
min-width: 44px;
|
|
order: map-get($toolbar-order-md, menu-toggle-start);
|
|
|
|
icon {
|
|
padding: 0 6px;
|
|
font-size: 2.4rem;
|
|
}
|
|
}
|
|
|
|
.bar-button-menu-toggle[end],
|
|
.bar-button-menu-toggle[right] {
|
|
margin: 0 2px;
|
|
min-width: 28px;
|
|
order: map-get($toolbar-order-md, menu-toggle-end);
|
|
}
|
|
|
|
|
|
// Material Design Toolbar Color Generation
|
|
// --------------------------------------------------
|
|
|
|
@include md-bar-button-default(default, $bar-button-md-color);
|
|
|
|
@each $color-name, $color-value in $colors-md {
|
|
@include md-toolbar-theme($color-name, $color-value);
|
|
@include md-bar-button-default($color-name, $color-value);
|
|
@include md-bar-button-outline($color-name, $color-value);
|
|
@include md-bar-button-solid($color-name, $color-value);
|
|
}
|