mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
refactor(text-input): renamed some classes and removed some nesting
references #689
This commit is contained in:
@ -18,14 +18,10 @@ ion-label {
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
ion-input[stacked-label],
|
||||
ion-input[floating-label] {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
[stacked-label],
|
||||
[floating-label] {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
ion-label {
|
||||
align-self: stretch;
|
||||
|
@ -48,8 +48,8 @@ ion-label + [text-input] {
|
||||
transition: transform 150ms ease-in-out;
|
||||
}
|
||||
|
||||
[floating-label].has-focus ion-label,
|
||||
[floating-label].has-value ion-label {
|
||||
[floating-label].input-focused ion-label,
|
||||
[floating-label].input-has-value ion-label {
|
||||
transform: translate3d(0, 0, 0) scale(0.8);
|
||||
}
|
||||
|
||||
|
@ -37,11 +37,11 @@ ion-input:after {
|
||||
content: '';
|
||||
}
|
||||
|
||||
ion-input.has-focus:after {
|
||||
.input-focused:after {
|
||||
border-bottom: 2px solid $text-input-md-highlight-color;
|
||||
}
|
||||
|
||||
ion-input.ng-valid.has-value:after {
|
||||
ion-input.ng-valid.input-has-value:after {
|
||||
border-bottom: 2px solid $text-input-md-hightlight-color-valid;
|
||||
}
|
||||
|
||||
@ -59,8 +59,8 @@ ion-input.ng-invalid.ng-touched:after {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
[stacked-label].has-focus ion-label,
|
||||
[floating-label].has-focus ion-label {
|
||||
[stacked-label].input-focused ion-label,
|
||||
[floating-label].input-focused ion-label {
|
||||
color: $text-input-md-highlight-color;
|
||||
}
|
||||
|
||||
@ -78,8 +78,8 @@ ion-input.ng-invalid.ng-touched:after {
|
||||
transition: transform 150ms ease-in-out;
|
||||
}
|
||||
|
||||
[floating-label].has-focus ion-label,
|
||||
[floating-label].has-value ion-label {
|
||||
[floating-label].input-focused ion-label,
|
||||
[floating-label].input-has-value ion-label {
|
||||
transform: translate3d(0, 0, 0) scale(0.8);
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<input type="text">
|
||||
</ion-input>
|
||||
|
||||
<ion-input floating-label class="has-value">
|
||||
<ion-input floating-label class="input-has-value">
|
||||
<ion-label>Floating Label 2</ion-label>
|
||||
<input value="Has Value" type="text">
|
||||
</ion-input>
|
||||
|
@ -34,7 +34,7 @@ ion-input [text-input] {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
ion-input.has-focus [text-input] {
|
||||
.input-focused [text-input] {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
|
@ -372,7 +372,7 @@ export class TextInput {
|
||||
* @private
|
||||
*/
|
||||
focusChange(hasFocus) {
|
||||
this.renderer.setElementClass(this.elementRef, 'has-focus', hasFocus);
|
||||
this.renderer.setElementClass(this.elementRef, 'input-focused', hasFocus);
|
||||
if (!hasFocus) {
|
||||
this.deregMove();
|
||||
this.input.hideFocus(false);
|
||||
@ -383,7 +383,7 @@ export class TextInput {
|
||||
* @private
|
||||
*/
|
||||
hasValue(inputValue) {
|
||||
this.renderer.setElementClass(this.elementRef, 'has-value', inputValue && inputValue !== '');
|
||||
this.renderer.setElementClass(this.elementRef, 'input-has-value', inputValue && inputValue !== '');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user