Skip to content

refactor(devtools): make use of root level css variable.#127

Open
Kinbaum wants to merge 3 commits intomidday-ai:mainfrom
Kinbaum:devtools
Open

refactor(devtools): make use of root level css variable.#127
Kinbaum wants to merge 3 commits intomidday-ai:mainfrom
Kinbaum:devtools

Conversation

@Kinbaum
Copy link
Copy Markdown

@Kinbaum Kinbaum commented Dec 3, 2025

I replaced state-driven panel resizing with CSS custom properties set on the root HTML element. This decouples sizing from React state, lets CSS handle layout changes when the devtools panel moves or resizes, and provides a smoother developer experience when iterating on our own UIs.

Usage

If I'm building an interface with shadcn sidebar for example, then I can add the following classNames to the SidebarInset

className={cn(
    // ... inset classes
    process.env.NODE_ENV === 'development' &&
        '[&:has(.ai-devtools-panel-bottom)]:h-[calc(100dvh-var(--ai-devtools-panel-height))]',
    process.env.NODE_ENV === 'development' &&
        '[&:has(.ai-devtools-panel-right)]:mr-(--ai-devtools-panel-width)'
)}

Now my interface will automatically adjust based on the variable value. Solid DX win.

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 3, 2025

@Kinbaum is attempting to deploy a commit to the Pontus Abrahamsson's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Kinbaum
Copy link
Copy Markdown
Author

Kinbaum commented Dec 9, 2025

@pontusab Can I get your review on this PR?

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.

1 participant