Files
Brandy Carney ff1a8ac6c7 feat(sass): add the ability to pass a contrast color in the colors map to iOS
this adds the functions necessary for the other modes as well

BREAKING CHANGE:

Can now pass contrast to the colors map:

```
$colors-ios: (

  primary: (
    base: #327eff,
    contrast: yellow
  ),
  secondary: (
    base: #32db64,
    contrast: hotpink
  ),
  danger: #d91e18,
  light: #f4f4f4,
  dark: #222
) !default;
```

references #5445
2016-03-22 17:14:39 -04:00

143 lines
2.9 KiB
SCSS

@import "../../globals.ios";
@import "./tabs";
// iOS Tabs
// --------------------------------------------------
$tabbar-ios-background: $toolbar-ios-background !default;
$tabbar-ios-item-padding: 0 10px !default;
$tabbar-ios-item-font-size: 10px !default;
$tabbar-ios-item-icon-size: 30px !default;
$tabbar-ios-height: 49px !default;
$tab-button-ios-min-width: 80px !default;
$tab-button-ios-max-width: 240px !default;
$tab-button-ios-active-color: $toolbar-ios-active-color !default;
$tab-button-ios-inactive-color: $toolbar-ios-inactive-color !default;
tabbar {
border-top: 1px solid $toolbar-ios-border-color;
background: $tabbar-ios-background;
}
ion-tabs[tabbarPlacement=top] tabbar {
border-top: 0;
border-bottom: 1px solid $toolbar-ios-border-color;
}
.tab-button {
padding: $tabbar-ios-item-padding;
min-width: $tab-button-ios-min-width;
max-width: $tab-button-ios-max-width;
min-height: $tabbar-ios-height;
color: $tab-button-ios-inactive-color;
}
.tab-button:hover:not(.disable-hover),
.tab-button[aria-selected=true] {
color: $tab-button-ios-active-color;
}
.tab-button-text {
margin-top: 0;
margin-bottom: 0;
min-height: $tabbar-ios-item-font-size + 1;
font-size: $tabbar-ios-item-font-size;
}
.has-title-only .tab-button-text {
font-size: $tabbar-ios-item-font-size + 2;
}
.tab-button-icon {
min-width: $tabbar-ios-item-icon-size + 5;
height: $tabbar-ios-item-icon-size;
font-size: $tabbar-ios-item-icon-size;
&::before {
vertical-align: top;
}
}
[tabbarLayout=icon-right] .tab-button,
[tabbarLayout=icon-left] .tab-button {
.tab-button-text {
font-size: 1.4rem;
line-height: 1.1;
}
ion-icon {
min-width: 24px;
height: 26px;
font-size: 24px;
}
}
[tabbarLayout=icon-hide] .tab-button,
.tab-button.has-title-only {
min-height: $tabbar-ios-height - 8;
.tab-button-text {
margin: 2px 0;
font-size: 1.4rem;
line-height: 1.1;
}
}
[tabbarLayout=title-hide] .tab-button,
.tab-button.icon-only {
min-height: $tabbar-ios-height - 8;
}
&.hairlines ion-tabs {
tabbar {
border-top-width: $hairlines-width;
}
&[tabbarPlacement="top"] tabbar {
border-bottom-width: $hairlines-width;
}
}
// iOS Tabbar Color Mixin
// --------------------------------------------------
@mixin tabbar-ios($color-name, $color-base, $color-contrast) {
ion-tabs[#{$color-name}] tabbar {
border-color: darken($color-base, 10%);
background-color: $color-base;
.tab-button {
color: $color-contrast;
}
.tab-button:hover:not(.disable-hover),
.tab-button[aria-selected=true] {
color: $color-contrast;
}
}
}
// iOS Tabbar Color Generation
// --------------------------------------------------
@each $color-name, $color-base, $color-contrast in get-colors($colors-ios) {
@include tabbar-ios($color-name, $color-base, $color-contrast);
}