Files
Brandy Carney 9efa3ea3e6 feat(sass): add support for contrast color in MD mode colors map
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
2016-03-22 17:53:08 -04:00

121 lines
3.5 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: color($colors-md, primary) !default;
$text-input-md-hightlight-color-valid: color($colors-md, secondary) !default;
$text-input-md-hightlight-color-invalid: color($colors-md, danger) !default;
$text-input-md-margin-top: $item-md-padding-top !default;
$text-input-md-margin-right: ($item-md-padding-right / 2) !default;
$text-input-md-margin-bottom: $item-md-padding-bottom !default;
$text-input-md-margin-left: ($item-md-padding-left / 2) !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: $text-input-md-margin-top $text-input-md-margin-right $text-input-md-margin-bottom $text-input-md-margin-left;
padding: 0;
width: calc(100% - #{$text-input-md-margin-right} - #{$text-input-md-margin-left});
}
// 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;
right: 0;
bottom: 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-top: 8px;
margin-bottom: 8px;
margin-left: 0;
width: calc(100% - #{$text-input-md-margin-right});
}
.item-label-stacked ion-select,
.item-label-floating ion-select {
padding-top: 8px;
padding-bottom: 8px;
padding-left: 0;
}
.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 {
@include svg-background-image($text-input-md-input-clear-icon-svg);
right: ($item-md-padding-right / 2);
bottom: 2px;
width: $text-input-md-input-clear-icon-width;
background-size: $text-input-md-input-clear-icon-size;
}