Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
Improved coloring for the hint-text. (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan-H11 committed Mar 23, 2022
1 parent ad18acd commit 91cbbb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
(keydown.enter)="onEnter.emit()"
[class]="flavor"
[disabled]="disabled">
<small [class]="flavor+hintHaveColor()">{{hintText}}</small>
<small [className]="coloredLabel() ? flavor : ''">{{hintText}}</small>
</span>

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ small {
display: block;
color: $grey-font;
@each $name, $colors in $flavors {
&.#{$name}true {
&.#{$name} {
color: list.nth($colors, 1);
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/core/components/inputs/text-input/text-input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ export class TextInputComponent {
@Input() hintColored: boolean = false;
@Input() public flavor: Flavor = 'primary';


// eslint-disable-next-line @angular-eslint/no-output-on-prefix
@Output() public onEnter = new EventEmitter<InputEvent>();

hintHaveColor() {
return this.hintColored && !this.disabled;
coloredLabel(): string {
if(this.hintColored && !this.disabled){
return "colored";
} else {
return "";
}
}
}

0 comments on commit 91cbbb2

Please sign in to comment.