Skip to content

Commit ff9aaa5

Browse files
committed
feat(tooltip): add arrow and close btn styles
1 parent f6bc028 commit ff9aaa5

File tree

3 files changed

+52
-10
lines changed

3 files changed

+52
-10
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010

1111
@extend %tooltip-display !optional;
1212

13+
@include m(top) {
14+
@extend %arrow--top !optional;
15+
}
16+
17+
@include m(bottom) {
18+
@extend %arrow--bottom !optional;
19+
}
20+
21+
@include m(left) {
22+
@extend %arrow--left !optional;
23+
}
24+
25+
@include m(right) {
26+
@extend %arrow--right !optional;
27+
}
28+
1329
@include m(hidden) {
1430
@extend %tooltip--hidden !optional;
1531
}

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

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,52 @@
7575
@include css-vars($theme);
7676
$variant: map.get($theme, '_meta', 'variant');
7777

78+
$transparent-border: rem(4px) solid transparent;
79+
$color-border: rem(4px) solid var-get($theme, 'background');
80+
7881
%tooltip-display {
7982
display: inline-flex;
80-
justify-content: center;
81-
flex-flow: column wrap;
83+
align-items: flex-start;
84+
text-align: start;
8285
background: var-get($theme, 'background');
8386
color: var-get($theme, 'text-color');
8487
border-radius: var-get($theme, 'border-radius');
8588
box-shadow: map.get($theme, 'shadow');
86-
margin: 0 auto;
87-
padding: 0 rem(8px);
89+
padding: rem(4px) rem(8px);
90+
gap: rem(8px);
8891
min-height: rem(24px);
92+
min-width: rem(24px);
93+
max-width: 200px;
8994

90-
@if $variant == 'indigo' {
91-
padding: rem(4px) rem(8px);
95+
igx-icon {
96+
--component-size: 1;
9297
}
9398
}
9499

100+
%arrow--top {
101+
border-left: $transparent-border;
102+
border-right: $transparent-border;
103+
border-top: $color-border;
104+
}
105+
106+
%arrow--bottom {
107+
border-left: $transparent-border;
108+
border-right: $transparent-border;
109+
border-bottom: $color-border;
110+
}
111+
112+
%arrow--left {
113+
border-top: $transparent-border;
114+
border-bottom: $transparent-border;
115+
border-left: $color-border;
116+
}
117+
118+
%arrow--right {
119+
border-top: $transparent-border;
120+
border-bottom: $transparent-border;
121+
border-right: $color-border;
122+
}
123+
95124
%tooltip--hidden {
96125
display: none;
97126
}
@@ -112,6 +141,7 @@
112141
}
113142
} @else {
114143
%tooltip-display {
144+
line-height: rem(16px);
115145
font-size: rem(10px);
116146
font-weight: 600;
117147
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,6 @@ export class IgxTooltipDirective extends IgxToggleDirective implements OnDestroy
202202
this._arrowEl = document.createElement('div');
203203
this._arrowEl.classList.add('igx-tooltip--arrow');
204204
this._arrowEl.style.position = 'absolute';
205-
this._arrowEl.style.width = '8px';
206-
this._arrowEl.style.height = '8px';
207-
this._arrowEl.style.transform = 'rotate(45deg)';
208-
this._arrowEl.style.background = 'inherit';
209205
this.element.appendChild(this._arrowEl);
210206
}
211207

0 commit comments

Comments
 (0)