Skip to content

Conversation

@ardeora
Copy link
Contributor

@ardeora ardeora commented Oct 25, 2023

Fixes #6226

We cannot use em units because the scale of these units change based on the styles of the parent container. So the design tokens would have different behavior for nested elements.

Instead we calculate the computed fontSize style whenever the devtools are mounted and set a CSS variable --tsqd-font-size. The rest of the tokens can derive their value based on this CSS variable.

I have also added a window focus listener so that this computation is run again everytime the user focuses back on the browser. So if they change any styles in their stylesheet, we can recompute the inherited font-size.

@nx-cloud
Copy link

nx-cloud bot commented Oct 25, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1284e57. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 25, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1284e57:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

@vercel
Copy link

vercel bot commented Oct 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2023 7:46pm

@codecov-commenter
Copy link

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files Coverage Δ
packages/query-devtools/src/utils.tsx 43.70% <16.00%> (-5.50%) ⬇️

... and 81 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@ardeora ardeora merged commit e2a3ebd into TanStack:main Oct 25, 2023
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.

Devtools scale messed up in v5 due to 62.5% trick

2 participants