@import "../../themes/ionic.globals.ios"; // iOS Input // -------------------------------------------------- /// @prop - Background color of the input $text-input-ios-background-color: $list-ios-background-color !default; /// @prop - Margin top of the input $text-input-ios-margin-top: $item-ios-padding-top !default; // deprecated $text-input-ios-margin-right: ($item-ios-padding-end / 2) !default; /// @prop - Margin end of the input $text-input-ios-margin-end: $text-input-ios-margin-right !default; /// @prop - Margin bottom of the input $text-input-ios-margin-bottom: $item-ios-padding-bottom !default; // deprecated $text-input-ios-margin-left: 0 !default; /// @prop - Margin start of the input $text-input-ios-margin-start: $text-input-ios-margin-left !default; /// @prop - Width of the icon used to clear the input $text-input-ios-input-clear-icon-width: 30px !default; /// @prop - Color of the icon used to clear the input $text-input-ios-input-clear-icon-color: rgba(0, 0, 0, .5) !default; /// @prop - Icon used to clear the input $text-input-ios-input-clear-icon-svg: "" !default; /// @prop - Size of the icon used to clear the input $text-input-ios-input-clear-icon-size: 18px !default; /// @prop - Show the focus highlight when the input has focus $text-input-ios-show-focus-highlight: false !default; /// @prop - Show the valid highlight when it is valid and has a value $text-input-ios-show-valid-highlight: $text-input-ios-show-focus-highlight !default; /// @prop - Show the invalid highlight when it is invalid and has value $text-input-ios-show-invalid-highlight: $text-input-ios-show-focus-highlight !default; /// @prop - Color of the input highlight $text-input-ios-highlight-color: color($colors-ios, primary) !default; /// @prop - Color of the input highlight when valid $text-input-ios-highlight-color-valid: $text-input-highlight-color-valid !default; /// @prop - Color of the input highlight when invalid $text-input-ios-highlight-color-invalid: $text-input-highlight-color-invalid !default; // iOS Default Input // -------------------------------------------------- .text-input-ios { @include margin($text-input-ios-margin-top, $text-input-ios-margin-end, $text-input-ios-margin-bottom, $text-input-ios-margin-start); @include padding(0); width: calc(100% - #{($text-input-ios-margin-end + $text-input-ios-margin-start)}); } // iOS Inset Input // -------------------------------------------------- .input-ios .inset-input { @include padding(($item-ios-padding-top / 2), ($item-ios-padding-end / 2), ($item-ios-padding-bottom / 2), ($item-ios-padding-start / 2)); @include margin(($item-ios-padding-top / 2), $item-ios-padding-end, ($item-ios-padding-bottom / 2), 0); } // iOS Highlighted Input // -------------------------------------------------- // Input highlight mixin for focus, valid, and invalid states @mixin ios-input-highlight($highlight-color) { border-bottom-color: $highlight-color; } // Show the focus highlight when the input has focus @if ($text-input-ios-show-focus-highlight) { // In order to get a 2px border we need to add an inset // box-shadow 1px (this is to avoid the div resizing) // TODO remove all uses of input-has-focus in v4 // TODO remove all uses of input-has-value in v4 .item-ios.item-input.item-input-has-focus .item-inner, .item-ios.item-input.input-has-focus .item-inner { @include ios-input-highlight($text-input-ios-highlight-color); } // The last item in a list has a border on the item, not the // inner item, so add it to the item itself .list-ios .item-input.item-input-has-focus:last-child, .list-ios .item-input.input-has-focus:last-child { @include ios-input-highlight($text-input-ios-highlight-color); .item-inner { box-shadow: none; } } } // Show the valid highlight when it has the .ng-valid class and a value @if ($text-input-ios-show-valid-highlight) { .item-ios.item-input.ng-valid.item-input-has-value:not(.input-has-focus):not(.item-input-has-focus) .item-inner, .item-ios.item-input.ng-valid.input-has-value:not(.input-has-focus):not(.item-input-has-focus) .item-inner { @include ios-input-highlight($text-input-ios-highlight-color-valid); } .list-ios .item-input.ng-valid.item-input-has-value:not(.input-has-focus):not(.item-input-has-focus):last-child, .list-ios .item-input.ng-valid.input-has-value:not(.input-has-focus):not(.item-input-has-focus):last-child { @include ios-input-highlight($text-input-ios-highlight-color-valid); .item-inner { box-shadow: none; } } } // Show the invalid highlight when it has the invalid class and has been touched @if ($text-input-ios-show-invalid-highlight) { .item-ios.item-input.ng-invalid.ng-touched:not(.input-has-focus):not(.item-input-has-focus) .item-inner { @include ios-input-highlight($text-input-ios-highlight-color-invalid); } .list-ios .item-input.ng-invalid.ng-touched:not(.input-has-focus):not(.item-input-has-focus):last-child { @include ios-input-highlight($text-input-ios-highlight-color-invalid); .item-inner { box-shadow: none; } } } // iOS Stacked & Floating Inputs // -------------------------------------------------- .item-ios.item-label-stacked .text-input, .item-ios.item-label-floating .text-input { @include margin(8px, null, 8px, 0); width: calc(100% - #{$text-input-ios-margin-end}); } .item-ios.item-label-stacked .label-ios + .input + .cloned-input, .item-ios.item-label-floating .label-ios + .input + .cloned-input { @include margin-horizontal(0, null); } .item-label-stacked .select-ios, .item-label-floating .select-ios { @include padding(8px, null, 8px, 0); } // iOS Clear Input Icon // -------------------------------------------------- .input-ios[clearInput] { position: relative; } .input-ios[clearInput] .text-input { @include padding-horizontal(null, $text-input-ios-input-clear-icon-width); } .input-ios .text-input-clear-icon { @include position-horizontal(null, ($item-ios-padding-end / 2)); @include svg-background-image($text-input-ios-input-clear-icon-svg); width: $text-input-ios-input-clear-icon-width; background-size: $text-input-ios-input-clear-icon-size; }