Skip to content

Conversation

@mkrause
Copy link
Collaborator

@mkrause mkrause commented Aug 24, 2025

Before, hovering over a tab (which applies a bold font weight) would cause a layout shift due to the increased width of the bold text. In this PR this is resolved by adding a hidden placeholder for the hover style so that the tab already takes up the width it would when in hover state. It uses CSS grid to stack the hidden and visible text in the same grid cell so that the browser will take the width of the hidden text into account.

@mkrause mkrause self-assigned this Aug 24, 2025
@mkrause mkrause changed the title Tabs – Add an invisible placeholder element to prevent tab hover state from causing layout shift Tabs – Prevent tab hover state from causing layout shift Aug 24, 2025
@mkrause mkrause added this to the Baklava v1.0 milestone Aug 25, 2025
@mkrause mkrause merged commit a0aef55 into master Aug 25, 2025
4 checks passed
@mkrause mkrause deleted the mkrause/250824-tab-hover branch August 25, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants