refactor(components): update to use shadow DOM and work with css variables

- updates components to use shadow DOM or scoped if they require css variables
- moves global styles to an external stylesheet that needs to be imported
- adds support for additional colors and removes the Sass loops to generate colors for each component
- several property renames, bug fixes, and test updates

Co-authored-by: Manu Mtz.-Almeida <manu.mtza@gmail.com>
Co-authored-by: Adam Bradley <adambradley25@gmail.com>
Co-authored-by: Cam Wiegert <cam@camwiegert.com>
This commit is contained in:
Brandy Carney
2018-07-09 12:57:21 -04:00
parent a4659f03b4
commit a7f1f4daa7
710 changed files with 21327 additions and 21181 deletions

View File

@ -1,131 +1,32 @@
@import "./input";
@import "./input.ios.vars";
// iOS Input
// --------------------------------------------------
.native-input-ios {
@include placeholder($input-ios-placeholder-color);
@include margin($input-ios-margin-top, $input-ios-margin-end, $input-ios-margin-bottom, $input-ios-margin-start);
@include padding(0);
width: calc(100% - #{($input-ios-margin-end + $input-ios-margin-start)});
:host {
font-family: $input-ios-font-family;
font-size: $input-ios-font-size;
}
--padding-top: #{$input-ios-padding-top};
--padding-end: #{$input-ios-padding-end};
--padding-bottom: #{$input-ios-padding-bottom};
--padding-start: #{$input-ios-padding-start};
// iOS Inset Input
// --------------------------------------------------
.input-ios .inset-input {
@include padding($input-ios-inset-padding-top, $input-ios-inset-padding-end, $input-ios-inset-padding-bottom, $input-ios-inset-padding-start);
@include margin($input-ios-inset-margin-top, $input-ios-inset-margin-end, $input-ios-inset-margin-bottom, $input-ios-inset-margin-start);
--placeholder-color: #{$input-ios-placeholder-color};
}
// iOS Highlighted Input
// --------------------------------------------------
// TODO this is angular specific scss
// 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 ($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)
.item-ios.item-input.item-input-has-focus .item-inner {
@include ios-input-highlight($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 {
@include ios-input-highlight($input-ios-highlight-color);
.item-inner {
box-shadow: none;
}
}
}
// Show the valid highlight when it has the .ng-valid class and a value
@if ($input-ios-show-valid-highlight) {
.item-ios.item-input.ng-valid.item-input-has-value:not(.item-input-has-focus) .item-inner {
@include ios-input-highlight($input-ios-highlight-color-valid);
}
.list-ios .item-input.ng-valid.item-input-has-value:not(.item-input-has-focus):last-child {
@include ios-input-highlight($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 ($input-ios-show-invalid-highlight) {
.item-ios.item-input.ng-invalid.ng-touched:not(.item-input-has-focus) .item-inner {
@include ios-input-highlight($input-ios-highlight-color-invalid);
}
.list-ios .item-input.ng-invalid.ng-touched:not(.item-input-has-focus):last-child {
@include ios-input-highlight($input-ios-highlight-color-invalid);
.item-inner {
box-shadow: none;
}
}
}
// iOS Input After Label
// --------------------------------------------------
.label-ios + .input .native-input,
.label-ios + .input + .cloned-input {
@include margin-horizontal($input-ios-by-label-margin-start, null);
}
// iOS Stacked & Floating Inputs
// --------------------------------------------------
.item-ios.item-label-stacked .native-input,
.item-ios.item-label-floating .native-input {
@include margin(8px, null, 8px, 0);
width: calc(100% - #{$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);
}
// iOS Clear Input Icon
// --------------------------------------------------
.input-ios[clear-input] {
position: relative;
}
.input-ios[clear-input] .native-input {
@include padding-horizontal(null, $input-ios-input-clear-padding-end);
}
.input-ios .input-clear-icon {
@include position-horizontal(null, 0);
.input-clear-icon {
@include svg-background-image($input-ios-input-clear-icon-svg);
width: $input-ios-input-clear-icon-width;
height: $input-ios-input-clear-icon-width;
background-color: transparent;
background-size: $input-ios-input-clear-icon-size;
}
// iOS Inset Input
// --------------------------------------------------
// TODO: where is it apply
// :host(.inset-input) {
// @include padding($input-ios-inset-padding-top, $input-ios-inset-padding-end, $input-ios-inset-padding-bottom, $input-ios-inset-padding-start);
// @include margin($input-ios-inset-margin-top, $input-ios-inset-margin-end, $input-ios-inset-margin-bottom, $input-ios-inset-margin-start);
// }