mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
224 lines
5.5 KiB
SCSS
224 lines
5.5 KiB
SCSS
|
|
// Bar (Headers and Footers)
|
|
// -------------------------------
|
|
|
|
.bar {
|
|
@include user-select(none);
|
|
position: absolute;
|
|
right: 0;
|
|
left: 0;
|
|
z-index: 10;
|
|
|
|
display: -webkit-box;
|
|
display: box;
|
|
box-sizing: border-box;
|
|
padding: $bar-padding-portrait;
|
|
|
|
width: 100%;
|
|
height: $bar-height;
|
|
border-width: 0;
|
|
border-style: solid;
|
|
border-top: 1px solid transparent;
|
|
border-bottom: 1px solid $bar-default-border-color;
|
|
|
|
background-color: $bar-bg;
|
|
background-size: 0;
|
|
@media (min--moz-device-pixel-ratio: 1.5),
|
|
(-webkit-min-device-pixel-ratio: 1.5),
|
|
(min-device-pixel-ratio: 1.5),
|
|
(min-resolution: 144dpi),
|
|
(min-resolution: 1.5dppx) {
|
|
border-top: none !important;
|
|
border-bottom: none !important;
|
|
background-image: linear-gradient(0deg, $bar-default-border-color, $bar-default-border-color, 50%, transparent 50%);
|
|
background-position: bottom;
|
|
background-size: 100% 1px;
|
|
background-repeat: no-repeat;
|
|
}
|
|
|
|
&.bar-clear {
|
|
border: none;
|
|
background: none;
|
|
color: #fff;
|
|
.button {
|
|
color: #fff;
|
|
}
|
|
.title {
|
|
color: #fff;
|
|
}
|
|
}
|
|
|
|
&.bar-default {
|
|
@include bar-style($bar-default-bg, $bar-default-border-color, $gray-dark);
|
|
}
|
|
|
|
&.bar-secondary {
|
|
@include bar-style($bar-secondary-bg, $bar-secondary-border-color, $gray-dark);
|
|
}
|
|
&.bar-primary {
|
|
@include bar-style($bar-primary-bg, $bar-primary-border-color, $white);
|
|
}
|
|
&.bar-info {
|
|
@include bar-style($bar-info-bg, $bar-info-border-color, $white);
|
|
}
|
|
&.bar-success {
|
|
@include bar-style($bar-success-bg, $bar-success-border-color, $white);
|
|
}
|
|
&.bar-warning {
|
|
@include bar-style($bar-warning-bg, $bar-warning-border-color, $white);
|
|
}
|
|
&.bar-danger {
|
|
@include bar-style($bar-danger-bg, $bar-danger-border-color, $white);
|
|
}
|
|
&.bar-dark {
|
|
@include bar-style($bar-dark-bg, $bar-dark-border-color, $white);
|
|
}
|
|
|
|
// Title inside of a bar is centered
|
|
.title {
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
right: 0;
|
|
left: 0;
|
|
z-index: 0;
|
|
|
|
margin: 0;
|
|
|
|
min-width: 30px;
|
|
|
|
text-align: center;
|
|
|
|
// Go into ellipsis if too small
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
font-size: $bar-title-font-size;
|
|
|
|
line-height: $bar-height;
|
|
}
|
|
|
|
.title a {
|
|
color: inherit;
|
|
}
|
|
|
|
> .button {
|
|
z-index: 1;
|
|
padding: 0 $button-bar-button-padding;
|
|
height: $button-bar-button-height;
|
|
min-width: $button-bar-button-height + $button-bar-button-font-size;
|
|
min-height: $button-bar-button-height - 1;
|
|
font-size: $button-bar-button-font-size;
|
|
line-height: $button-bar-button-height - $button-border-width - 2;
|
|
|
|
.icon {
|
|
font-size: $button-bar-button-icon-size;
|
|
line-height: $button-bar-button-height - $button-border-width - 2;
|
|
}
|
|
}
|
|
|
|
.button-bar > .button {
|
|
height: $button-bar-button-height;
|
|
min-height: $button-bar-button-height - 1;
|
|
line-height: $button-bar-button-height - 2;
|
|
}
|
|
|
|
.button-bar + .button, .button + .button-bar {
|
|
margin-left: 5px;
|
|
}
|
|
|
|
// Place the last button in a bar on the right of the bar
|
|
.title + .button:last-child,
|
|
> .button + .button:last-child,
|
|
> .button.pull-right,
|
|
.title + .buttons {
|
|
position: absolute;
|
|
top: 5px;
|
|
right: 5px;
|
|
bottom: 5px;
|
|
}
|
|
|
|
}
|
|
|
|
// Default styles for buttons inside of styled bars
|
|
|
|
.bar-default {
|
|
.button {
|
|
@include button-style($button-default-bg, $button-default-border, $button-default-active-bg, $button-default-active-border, $gray-dark);
|
|
@include button-clear($gray-dark, $bar-title-font-size);
|
|
}
|
|
}
|
|
|
|
.bar-secondary {
|
|
.button {
|
|
@include button-style($button-secondary-bg, $button-secondary-border, $button-secondary-active-bg, $button-secondary-active-border, $gray-dark);
|
|
@include button-clear($gray-dark, $bar-title-font-size);
|
|
}
|
|
}
|
|
|
|
.bar-primary {
|
|
.button {
|
|
@include button-style($button-primary-bg, $button-primary-border, $button-primary-active-bg, $button-primary-active-border, $white);
|
|
@include button-clear($white, $bar-title-font-size);
|
|
}
|
|
}
|
|
.bar-info {
|
|
.button {
|
|
@include button-style($button-info-bg, $button-info-border, $button-info-active-bg, $button-info-active-border, $white);
|
|
@include button-clear($white, $bar-title-font-size);
|
|
}
|
|
}
|
|
.bar-success {
|
|
.button {
|
|
@include button-style($button-success-bg, $button-success-border, $button-success-active-bg, $button-success-active-border, $white);
|
|
@include button-clear($white, $bar-title-font-size);
|
|
}
|
|
}
|
|
.bar-warning {
|
|
.button {
|
|
@include button-style($button-warning-bg, $button-warning-border, $button-warning-active-bg, $button-warning-active-border, $white);
|
|
@include button-clear($white, $bar-title-font-size);
|
|
}
|
|
}
|
|
.bar-danger {
|
|
.button {
|
|
@include button-style($button-danger-bg, $button-danger-border, $button-danger-active-bg, $button-danger-active-border, $white);
|
|
@include button-clear($white, $bar-title-font-size);
|
|
}
|
|
}
|
|
.bar-dark {
|
|
// A default style for buttons
|
|
.button {
|
|
@include button-style($button-dark-bg, $button-dark-border, $button-dark-active-bg, $button-dark-active-border, $white);
|
|
@include button-clear($white, $bar-title-font-size);
|
|
}
|
|
}
|
|
|
|
// Header at top
|
|
.bar-header {
|
|
top: 0;
|
|
border-top-width: 0;
|
|
border-bottom-width: 1px;
|
|
}
|
|
|
|
// Footer at bottom
|
|
.bar-footer {
|
|
bottom: 0;
|
|
border-top-width: 1px;
|
|
border-bottom-width: 0;
|
|
background-position: top;
|
|
}
|
|
|
|
// Don't render padding if the bar is just for tabs
|
|
.bar-tabs {
|
|
padding: 0;
|
|
}
|
|
|
|
.bar-subheader {
|
|
top: $bar-height;
|
|
display: block;
|
|
}
|
|
.bar-subfooter {
|
|
bottom: $bar-height;
|
|
display: block;
|
|
}
|