From 8b5f0463dba36940d10d08f54d0babd18b2dc06c Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Wed, 11 Dec 2024 11:51:25 +0100 Subject: [PATCH] fix(material/tooltip): body line height affecting gap 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 {