elastic/kibana

[Dashboard] Missing panel title h2 style

Open

#239708 opened on Oct 20, 2025

View on GitHub
 (3 comments) (0 reactions) (1 assignee)TypeScript (19,065 stars) (8,021 forks)batch import
Feature:DashboardTeam:Presentationbuggood first issueimpact:lowloe:small

Description

Kibana version: 8.x, 9.x

Describe the bug:

An h2 element is wrapping the panel title when the panel has a description, when not it just uses the panelTitleElement.

https://github.com/elastic/kibana/blob/b5314276e7299f16b170d91b20ec5e07a52a3160/src/platform/plugins/private/presentation_panel/public/panel_component/panel_header/presentation_panel_title.tsx#L90-L92

https://github.com/elastic/kibana/blob/b5314276e7299f16b170d91b20ec5e07a52a3160/src/platform/plugins/private/presentation_panel/public/panel_component/panel_header/presentation_panel_title.tsx#L114-L137

This h2 doesn't own its style, but is inherited. Unfortunately a style override (from a browser extensions for example) at the body/html level could wrongly updates the font-size of this header causing the title to be larger then the required size. EUI doesn't block this behaviour and the h2 is not styled to prevent that.

Steps to reproduce:

  1. create a dashboard with two panels, one with just the title, the other with title and description
  2. add a custom h2 style with font-size: 40px or more
  3. you will notice that the panel with description increases in font-size.

Expected behavior: It should behave as every other h2 elements aka EuiTitles and it should not be overwritten by custom styles.

Also the other wrong fact is that it has semantically a different meaning then the title without the description that is just a link or a span if in read-only mode.

Screenshots (if relevant):

Contributor guide