canonical / canonical/vanilla-framework

Alignment of round icon in a heading h4

Open
#4,891 6 comments 0 reactions 0 assignees View on GitHub
P3 Triaged Triaged: Pragma
Dominant language
HTML
Stars
983
Forks
216
Avg merge
3d 13h
Merged PRs (30d)
3

Description

**Describe the bug**

Consider a h4 heading is containing text with an info icon next to it. The icon seems to float above the baseline. I think this is a visual oddity due to the shape of the icon with the round outline.

**To Reproduce**

Steps to reproduce the behavior:

1. Render this bit: `

Further reading

`
2. See rendered result

**Expected behavior**

The icon should appear on the header text baseline

**Screenshots**

![Screenshot from 2023-10-12 12-06-28](https://github.com/canonical/vanilla-framework/assets/1155472/2767ba2a-4984-4898-a824-d41083984c03)
![Screenshot from 2023-10-12 12-06-23](https://github.com/canonical/vanilla-framework/assets/1155472/33df6281-036c-4d46-a28d-a534a13f011b)

**Desktop (please complete the following information):**

- OS: Ubuntu
- Browser Chrome
- Version 117

**Additional context**

We encountered this in https://github.com/canonical/lxd-ui/pull/483 where info icons are placed in headings for LXD-UI to link to the documentation. Temporary mitigation is adding some top margin to the icon, so it is pushed down a bit and appears aligned.

Contributor guide

Open the contributing guide

Research direction

Start by rendering the provided h4 snippet and inspect the styles applied to p-icon--information alongside h4. Compare the icon’s baseline with the heading text and verify that the icon is visually aligned without the temporary top-margin workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html
Domain
design, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.