mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 13:01:01 +08:00

BREAKING CHANGE: Can now pass contrast to the colors map: ``` $colors-md: ( primary: ( base: #327eff, contrast: yellow ), secondary: ( base: #32db64, contrast: hotpink ), danger: #d91e18, light: #f4f4f4, dark: #222 ) !default; ``` references #5445
94 lines
2.3 KiB
SCSS
94 lines
2.3 KiB
SCSS
@import "../../globals.md";
|
|
@import "./segment";
|
|
|
|
// Material Design Segment
|
|
// --------------------------------------------------
|
|
|
|
$segment-button-md-text-color-activated: $toolbar-md-active-color !default;
|
|
$segment-button-md-border-color-activated: $toolbar-md-active-color !default;
|
|
|
|
$segment-button-md-border-bottom-width: 2px !default;
|
|
$segment-button-md-border-bottom-color: rgba(#000, .10) !default;
|
|
|
|
$segment-button-md-padding: 0 6px !default;
|
|
$segment-button-md-height: 4.2rem !default;
|
|
$segment-button-md-line-height: 4rem !default;
|
|
$segment-button-md-font-size: 1.2rem !default;
|
|
$segment-button-md-icon-size: 2.6rem !default;
|
|
$segment-button-md-icon-line-height: $segment-button-md-line-height !default;
|
|
|
|
|
|
.segment-button {
|
|
flex: 1;
|
|
|
|
padding: $segment-button-md-padding;
|
|
|
|
width: 0;
|
|
height: $segment-button-md-height;
|
|
|
|
border-bottom-width: $segment-button-md-border-bottom-width;
|
|
border-bottom-style: solid;
|
|
border-bottom-color: $segment-button-md-border-bottom-color;
|
|
|
|
font-size: $segment-button-md-font-size;
|
|
font-weight: 500;
|
|
line-height: $segment-button-md-line-height;
|
|
text-transform: uppercase;
|
|
|
|
color: $segment-button-md-text-color-activated;
|
|
background-color: transparent;
|
|
opacity: .7;
|
|
transition: 100ms all linear;
|
|
|
|
ion-icon {
|
|
font-size: $segment-button-md-icon-size;
|
|
line-height: $segment-button-md-icon-line-height;
|
|
}
|
|
|
|
&.activated,
|
|
&.segment-activated {
|
|
opacity: 1;
|
|
border-color: $segment-button-md-border-color-activated;
|
|
}
|
|
}
|
|
|
|
.toolbar {
|
|
|
|
ion-segment {
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.segment-button.activated,
|
|
.segment-button.segment-activated {
|
|
opacity: 1;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// Material Design Segment Button Mixin
|
|
// --------------------------------------------------
|
|
|
|
@mixin md-segment-button($color-name, $color-base, $color-contrast) {
|
|
|
|
ion-segment[#{$color-name}] .segment-button {
|
|
color: $color-base;
|
|
|
|
&.activated,
|
|
&.segment-activated {
|
|
border-color: $color-base;
|
|
color: $color-base;
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// Material Design Segment Color Generation
|
|
// --------------------------------------------------
|
|
|
|
@each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
|
|
@include md-segment-button($color-name, $color-base, $color-contrast);
|
|
}
|