Skip to content

Commit

Permalink
fix(module:tooltip): color of the tooltip arrow does not change (#8192)
Browse files Browse the repository at this point in the history
* fix(module:tooltip): color of the tooltip arrow does not change

* fix(module:tooltip): color of the tooltip arrow does not change

* fix(module:tooltip): color of the tooltip arrow does not change
  • Loading branch information
ParsaArvanehPA authored Dec 4, 2023
1 parent 4e2cb74 commit bc344ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 4 additions & 6 deletions components/tooltip/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

@tooltip-arrow-shadow-width: 3px;

@tooltip-arrow-rotate-width: sqrt(@tooltip-arrow-width * @tooltip-arrow-width * 2) +
@tooltip-arrow-shadow-width * 2;
@tooltip-arrow-rotate-width: sqrt(@tooltip-arrow-width * @tooltip-arrow-width * 2) + @tooltip-arrow-shadow-width * 2;

@tooltip-arrow-offset-vertical: 5px; // 8 - 3px
@tooltip-arrow-offset-horizontal: 13px; // 16 - 3px
Expand Down Expand Up @@ -82,10 +81,9 @@

&-content {
// Use linear gradient to mix box shadow of tooltip inner
--antd-arrow-background-color: linear-gradient(
to right bottom,
fadeout(@tooltip-bg, 10%),
@tooltip-bg
--antd-arrow-background-color: var(
--color, // used when setting custom color, fallback is provide line below in case no color is set
linear-gradient(to right bottom, fadeout(@tooltip-bg, 10%), @tooltip-bg) // fallback
);

position: absolute;
Expand Down
3 changes: 2 additions & 1 deletion components/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ export class NzToolTipComponent extends NzTooltipBaseComponent {
};

this._contentStyleMap = {
backgroundColor: !!this.nzColor && !isColorPreset ? this.nzColor : null
backgroundColor: !!this.nzColor && !isColorPreset ? this.nzColor : null,
'--color': this.nzColor
};
}
}

0 comments on commit bc344ed

Please sign in to comment.