Skip to content

Commit

Permalink
fix(core): do not override nested tui-icon styles (#9065)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Sep 18, 2024
1 parent e7642cb commit 4e07f24
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/core/styles/components/textfield.less
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ tui-textfield {
& ~ .t-content {
opacity: var(--tui-disabled-opacity);

tui-icon {
> tui-icon {
display: none;
}
}
Expand Down Expand Up @@ -286,7 +286,7 @@ tui-textfield {
margin-inline-start: auto;
isolation: isolate;

tui-icon {
> tui-icon {
pointer-events: auto;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<tui-segmented>
<button
*ngFor="let state of statuses"
type="button"
(click)="status = state"
>
{{ state }}
</button>
</tui-segmented>

<tui-textfield>
<label tuiLabel>Card number</label>
<input
icon=""
tuiInputCard
tuiTextfield
[disabled]="status === 'disabled'"
[invalid]="status === 'invalid'"
[readOnly]="status === 'readOnly'"
[(ngModel)]="card"
/>
<tui-thumbnail-card
*ngIf="card.startsWith('1234')"
iconStart="@tui.dollar-sign"
paymentSystem="visa"
size="s"
[style.background]="background"
/>
</tui-textfield>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:host {
display: flex;
flex-direction: column;
gap: 1rem;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {NgForOf, NgIf} from '@angular/common';
import {Component} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiInputCard, TuiThumbnailCard} from '@taiga-ui/addon-commerce';
import {TuiButton, TuiTextfield} from '@taiga-ui/core';
import {TuiSegmented} from '@taiga-ui/kit';

@Component({
standalone: true,
imports: [
FormsModule,
NgForOf,
NgIf,
TuiButton,
TuiInputCard,
TuiSegmented,
TuiTextfield,
TuiThumbnailCard,
],
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
changeDetection,
})
export default class Example {
protected statuses = ['normal', 'disabled', 'readOnly', 'invalid'] as const;
protected status: string = this.statuses[0];
protected card = '1234123412341234';
protected background =
'#2b9aff linear-gradient(110deg, transparent 70%, #0780ff 71%, #db028b 100%)';
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default class Example {
'A cool one',
'Backgrounds',
'External colored icon',
'Textfield',
];

protected readonly iconVariants = ['', '@tui.lock', '@tui.cloud', '@tui.user'];
Expand Down

0 comments on commit 4e07f24

Please sign in to comment.