Files
2015-12-08 15:44:11 -05:00

91 lines
2.4 KiB
SCSS

@import "../../../globals.md";
@import "../label";
@import "../text-input";
// Material Design Text Input
// --------------------------------------------------
$text-input-md-background-color: $list-md-background-color !default;
$text-input-md-label-color: #999 !default;
$text-input-md-highlight-color: map-get($colors-md, primary) !default;
$text-input-md-hightlight-color-valid: map-get($colors-md, secondary) !default;
$text-input-md-hightlight-color-invalid: map-get($colors-md, danger) !default;
[text-input] {
margin: $item-md-padding-top ($item-md-padding-right / 2) $item-md-padding-bottom ($item-md-padding-left / 2);
padding: 0;
background-color: $text-input-md-background-color;
}
ion-input[inset] [text-input] {
margin: ($item-md-padding-top / 2) $item-md-padding-right ($item-md-padding-bottom / 2) $item-md-padding-left;
padding: ($item-md-padding-top / 2) ($item-md-padding-right / 2) ($item-md-padding-bottom / 2) ($item-md-padding-left / 2);
}
ion-label {
margin: $item-md-padding-top ($item-md-padding-right / 2) $item-md-padding-bottom ($item-md-padding-left / 2);
color: $text-input-md-label-color;
}
ion-input:after {
position: absolute;
bottom: 0;
right: 0;
left: $item-md-padding-left;
border-bottom: 2px solid transparent;
content: '';
}
.input-focused:after {
border-bottom: 2px solid $text-input-md-highlight-color;
}
ion-input.ng-valid.input-has-value:after {
border-bottom: 2px solid $text-input-md-hightlight-color-valid;
}
ion-input.ng-invalid.ng-touched:after {
border-bottom: 2px solid $text-input-md-hightlight-color-invalid;
}
[stacked-label] ion-label {
font-size: 1.2rem;
margin-bottom: 0;
}
[stacked-label] ion-label,
[floating-label] ion-label {
margin-left: 0;
}
[stacked-label].input-focused ion-label,
[floating-label].input-focused ion-label {
color: $text-input-md-highlight-color;
}
[stacked-label] [text-input],
[floating-label] [text-input] {
margin-bottom: 8px;
margin-top: 8px;
margin-left: 0;
}
[floating-label] ion-label {
margin-bottom: 0;
transform-origin: left top;
transform: translate3d(0, 27px, 0);
transition: transform 150ms ease-in-out;
}
[floating-label].input-focused ion-label,
[floating-label].input-has-value ion-label {
transform: translate3d(0, 0, 0) scale(0.8);
}
@each $color-name, $color-value in $colors-md {
ion-label[#{$color-name}] {
color: $color-value !important;
}
}