Files
2017-03-29 20:28:25 +02:00

126 lines
3.4 KiB
SCSS

@import "../../themes/ionic.globals.md";
// Material Design Segment
// --------------------------------------------------
/// @prop - Text color of the activated segment button
$segment-button-md-text-color-activated: $toolbar-md-active-color !default;
/// @prop - Border color of the activated segment button
$segment-button-md-border-color-activated: $toolbar-md-active-color !default;
/// @prop - Width of the bottom border on the segment button
$segment-button-md-border-bottom-width: 2px !default;
/// @prop - Color of the bottom border on the segment button
$segment-button-md-border-bottom-color: rgba(#000, .10) !default;
/// @prop - Opacity of the segment button
$segment-button-md-opacity: .7 !default;
/// @prop - Opacity of the activated segment button
$segment-button-md-opacity-activated: 1 !default;
/// @prop - Opacity of the disabled segment button
$segment-button-md-opacity-disabled: .3 !default;
/// @prop - Padding of the segment button
$segment-button-md-padding: 0 6px !default;
/// @prop - Height of the segment button
$segment-button-md-height: 4.2rem !default;
/// @prop - Line height of the segment button
$segment-button-md-line-height: 4rem !default;
/// @prop - Font size of the segment button
$segment-button-md-font-size: 1.2rem !default;
/// @prop - Size of an icon in the segment button
$segment-button-md-icon-size: 2.6rem !default;
/// @prop - Line height of an icon in the segment button
$segment-button-md-icon-line-height: $segment-button-md-line-height !default;
.segment-md .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: $segment-button-md-opacity;
transition: 100ms all linear;
ion-icon {
font-size: $segment-button-md-icon-size;
line-height: $segment-button-md-icon-line-height;
}
&.activated,
&.segment-activated {
border-color: $segment-button-md-border-color-activated;
opacity: $segment-button-md-opacity-activated;
}
}
.segment-md.segment-disabled,
.segment-md .segment-button-disabled {
opacity: $segment-button-md-opacity-disabled;
pointer-events: none;
}
.toolbar {
.segment-md {
margin: 0 auto;
}
.segment-md .segment-button.activated,
.segment-md .segment-button.segment-activated {
opacity: 1;
}
}
// Material Design Segment Button Mixin
// --------------------------------------------------
@mixin md-segment-button($color-name, $color-base, $color-contrast) {
.segment-md-#{$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);
}