fix: Inspect panel styles break when host page sets a custom html font-size (rem-based units)

Open Beginner friendly
#973 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
css, typescript
Domain
frontend

Research direction

Start in packages/devtools/src/webcomponents/.generated/css.ts and inspect the rem-based dimensions used by the inspect panel. Reproduce the panel with a host page whose html font-size is 41.4px, then verify it renders consistently with the default font size after the CSS units are updated.

Written by the indexing model from the issue text.

Description

bug
🐛 The bug

When a host application uses postcss-pxtorem (or similar tools) to set a non-default font-size on for mobile responsive layouts (e.g. font-size: 41.4px instead of the browser default 16px), the nuxt-devtools-inspect-panel web component renders incorrectly.

The root cause is that the generated CSS in packages/devtools/src/webcomponents/.generated/css.ts uses rem units.
Since rem is relative to the host page's font-size — not the web component's own root — all rem-based
dimensions in the inspect panel scale incorrectly.

🛠️ To reproduce

[]

🌈 Expected behavior

The inspect panel should render consistently regardless of the host page's root font-size.

ℹ️ Additional context

Replace rem with px (or em scoped to the component's own font-size) in the web component's CSS, since web components don't inherit a predictable rem baseline from the host page.

Dominant language
TypeScript
Stars
3.3k
Forks
214
Avg merge
19h 45m
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nuxt/devtools

All issues in nuxt/devtools

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.