Skip to content

Commit

Permalink
feat(kit): Tooltip add small size (#10154)
Browse files Browse the repository at this point in the history
Co-authored-by: taiga-family-bot <taiga-family-bot@users.noreply.github.com>
  • Loading branch information
waterplea and taiga-family-bot authored Jan 13, 2025
1 parent e0e5861 commit 32e78bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions projects/kit/directives/tooltip/tooltip.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Component,
Directive,
inject,
Input,
ViewEncapsulation,
} from '@angular/core';
import {toSignal} from '@angular/core/rxjs-interop';
Expand All @@ -23,6 +24,7 @@ import {
TuiHintHover,
} from '@taiga-ui/core/directives/hint';
import {TUI_ICON_START} from '@taiga-ui/core/tokens';
import type {TuiSizeS} from '@taiga-ui/core/types';
import {map} from 'rxjs';

import {TUI_TOOLTIP_OPTIONS} from './tooltip.options';
Expand Down Expand Up @@ -63,6 +65,7 @@ class TuiTooltipStyles {}
],
host: {
tuiTooltip: '',
'[attr.data-size]': 'size',
'(click.prevent)': '0',
'(mousedown)': 'onClick($event)',
},
Expand All @@ -84,6 +87,9 @@ export class TuiTooltip implements DoCheck {
),
);

@Input()
public size: TuiSizeS = 'm';

public ngDoCheck(): void {
if (this.textfield?.id) {
this.describe.tuiHintDescribe = this.textfield.id;
Expand Down
5 changes: 3 additions & 2 deletions projects/kit/directives/tooltip/tooltip.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@

[tuiBlock],
[tuiCell][data-size='s'],
[tuiLabel][data-orientation='horizontal'] & {
border-width: 0.25rem;
[tuiLabel][data-orientation='horizontal'] &,
&[data-size='s'] {
font-size: 1.25rem;
}

[tuiTitle] & {
Expand Down

0 comments on commit 32e78bf

Please sign in to comment.