From c04f84fd3b81dbf5e1e76304845f51d16f365ab3 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 12 Dec 2024 21:57:49 +0100 Subject: [PATCH] fix(material/tooltip): body line height affecting gap (#30164) Fixes that the line height of the `body` element was affecting the gap between the tooltip and the trigger. Fixes #30132. --- src/material/tooltip/tooltip.scss | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/material/tooltip/tooltip.scss b/src/material/tooltip/tooltip.scss index 2371550ad14c..ab314afdf322 100644 --- a/src/material/tooltip/tooltip.scss +++ b/src/material/tooltip/tooltip.scss @@ -98,9 +98,14 @@ } } -// We need the additional specificity here, because it can be overridden by `.cdk-overlay-panel`. -.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive { - pointer-events: none; +.mat-mdc-tooltip-panel { + // The line height inherited from the body can throw off the tooltip gap (see #30132). + line-height: normal; + + // We need the additional specificity here, because it can be overridden by `.cdk-overlay-panel`. + &.mat-mdc-tooltip-panel-non-interactive { + pointer-events: none; + } } @keyframes mat-mdc-tooltip-show {