mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 21:15:24 +08:00
102 lines
2.9 KiB
SCSS
102 lines
2.9 KiB
SCSS
@import "../../globals.md";
|
|
@import "./input";
|
|
|
|
// Material Design Input
|
|
// --------------------------------------------------
|
|
|
|
$text-input-md-background-color: $list-md-background-color !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-md-input-clear-icon-width: 30px !default;
|
|
$text-input-md-input-clear-icon-color: #5B5B5B !default;
|
|
$text-input-md-input-clear-icon-svg: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><polygon fill='" + $text-input-md-input-clear-icon-color + "' points='405,136.798 375.202,107 256,226.202 136.798,107 107,136.798 226.202,256 107,375.202 136.798,405 256,285.798 375.202,405 405,375.202 285.798,256'/></svg>" !default;
|
|
$text-input-md-input-clear-icon-size: 22px !default;
|
|
|
|
|
|
|
|
// Material Design Default Input
|
|
// --------------------------------------------------
|
|
|
|
.text-input {
|
|
margin: $item-md-padding-top ($item-md-padding-right / 2) $item-md-padding-bottom ($item-md-padding-left / 2);
|
|
padding: 0;
|
|
}
|
|
|
|
|
|
// Material Design Inset Input
|
|
// --------------------------------------------------
|
|
|
|
.inset-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);
|
|
}
|
|
|
|
|
|
// Material Design Highlighted Input
|
|
// --------------------------------------------------
|
|
|
|
ion-input:after {
|
|
position: absolute;
|
|
bottom: 0;
|
|
right: 0;
|
|
left: $item-md-padding-left;
|
|
border-bottom-width: 2px;
|
|
border-bottom-style: solid;
|
|
border-bottom-color: transparent;
|
|
content: '';
|
|
}
|
|
|
|
.input-has-focus:after {
|
|
border-bottom-color: $text-input-md-highlight-color;
|
|
}
|
|
|
|
ion-input.ng-valid.input-has-value:after {
|
|
border-bottom-color: $text-input-md-hightlight-color-valid;
|
|
}
|
|
|
|
ion-input.ng-invalid.ng-touched:after {
|
|
border-bottom-color: $text-input-md-hightlight-color-invalid;
|
|
}
|
|
|
|
|
|
// Material Design Stacked & Floating Inputs
|
|
// --------------------------------------------------
|
|
|
|
.item-label-stacked .text-input,
|
|
.item-label-floating .text-input {
|
|
margin-left: 0;
|
|
margin-top: 8px;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.item-label-floating .text-input.cloned-input {
|
|
top: 32px;
|
|
}
|
|
|
|
.item-label-stacked .text-input.cloned-input {
|
|
top: 27px;
|
|
}
|
|
|
|
|
|
// Material Design Clear Input Icon
|
|
// --------------------------------------------------
|
|
|
|
ion-input[clearInput] {
|
|
position: relative;
|
|
|
|
.text-input {
|
|
padding-right: $text-input-md-input-clear-icon-width;
|
|
}
|
|
}
|
|
|
|
.text-input-clear-icon {
|
|
width: $text-input-md-input-clear-icon-width;
|
|
|
|
@include svg-background-image($text-input-md-input-clear-icon-svg);
|
|
background-size: $text-input-md-input-clear-icon-size;
|
|
right: ($item-md-padding-right / 2);
|
|
bottom: 2px;
|
|
}
|