Skip to content

Commit a96d368

Browse files
committed
refactor(tooltip): improve slotted content detection for styling purposes
1 parent 3f3bbd2 commit a96d368

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

projects/igniteui-angular/src/lib/core/styles/components/tooltip/_tooltip-theme.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
gap: rem(8px);
2424
min-height: rem(24px);
2525
min-width: rem(24px);
26-
max-width: var(--igx-tooltip-max-width, 200px);
26+
max-width: rem(200px);
2727
width: fit-content;
2828

2929
igx-icon {
@@ -34,10 +34,10 @@
3434
display: flex;
3535
cursor: default;
3636
}
37-
}
3837

39-
.igx-tooltip:has(> :not([data-arrow], igx-tooltip-close-button)) {
40-
--igx-tooltip-max-width: none;
38+
&:not([data-default]) {
39+
max-width: initial;
40+
}
4141
}
4242

4343
%arrow--top {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<span igxTooltip>{{content}}</span>
1+
<span data-default igxTooltip>{{content}}</span>

projects/igniteui-angular/src/lib/directives/tooltip/tooltip.directive.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ describe('IgxTooltip', () => {
529529
verifyTooltipVisibility(tooltipNativeElement, tooltipTarget, true);
530530

531531
const maxWidth = getComputedStyle(tooltipNativeElement).maxWidth;
532-
expect(maxWidth).toBe('none');
532+
expect(maxWidth).toBe('initial');
533533
}));
534534
});
535535

0 commit comments

Comments
 (0)