Skip to content

Use Tailwind in place of custom styles (DOC-426) - #8222

Draft
ethanpalm wants to merge 1 commit into
mainfrom
ethan/doc-426-update-public-docs-styles-with-tailwind
Draft

ethanpalm wants to merge 1 commit into
mainfrom
ethan/doc-426-update-public-docs-styles-with-tailwind

Conversation

@ethanpalm

Copy link
Copy Markdown
Collaborator

Part of DOC-426: use Tailwind on our own docs in place of custom CSS and style props.

In this PR so far

  • assistant/use.mdx: replaces the style props on the assistant screenshots with w-[268px] h-auto. This change works.

The bigger job is playground.css (646 lines, all styling for snippets/assistant-widget-playground.jsx). Two compiler bugs, described below, block a clean conversion, so it isn't in this PR yet.

Compiler bugs found while probing

Tested in mint dev (CLI 4.2.1171) with probe classes on the playground snippet, then reverted. Mintlify rewrites class names to a mint- prefix at compile time, and these two cases go wrong there.

1. Arbitrary properties get the prefix in the wrong place

Source Compiled CSS generated
[--pgx:#f8f8f8] mint-[--pgx:#f8f8f8] none
dark:[--pgx:#1c1c1c] dark:mint-[--pgx:#1c1c1c] none
[clip-path:inset(50%)] mint-[clip-path:inset(50%)] none

This means CSS variables can't be set from Tailwind.

2. Any class containing a comma is dropped

The class isn't prefixed and no CSS is generated. No error is shown.

Source Compiled CSS generated
w-[min(100%,720px)] / w-[min(100%,_720px)] unchanged none
bg-[color-mix(in_srgb,var(--a),var(--b)_4%)] unchanged none
bg-[color:color-mix(in_srgb,#fcfcfc,#171717_4%)] unchanged none
dark:shadow-[0_0_0_1px_rgba(255,255,255,0.12)] unchanged none

This rules out rgba(), min()/max()/clamp(), color-mix(), and every multi-layer box-shadow. Our custom-scripts.mdx tells customers arbitrary values work, so customers hit this too.

Working for comparison

All of these generated correct CSS: dark: (:is(.dark *)), has-[input:focus-visible]:, data-[active=true]:, group-data-[open=true]/pg:, [&_svg]:, [&>span]:, [&[hidden]]:, motion-reduce:, max-[540px]:, min-[541px]:, animate-[spin_700ms_linear_infinite] (resolves to mint-spin keyframes), shadow-[0_0_0_1px_var(--x)], text-[13px]/[20px], and classes inside both branches of a ternary in a template literal.

Plan for the playground

Unless the bugs above get fixed first, keep about 60 lines of CSS: light/dark color and shadow tokens, plus the preview-page rules that hide Mintlify's own chrome (which have to stay CSS). Move layout, spacing, type, and states into Tailwind classes that reference the tokens.

🤖 Generated with Claude Code

The assistant screenshots set width and height through the style prop,
which our own guidance now tells users to avoid because it can cause a
layout shift on page load. Arbitrary values make the style prop
unnecessary here.

Verified in a mint dev build: the classes resolve to
.mint-w-\[268px\] { width: 268px } with matching CSS generated.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mintlify

mintlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Mintlify Docs 🟢 Ready View Preview Oct 31, 2026, 5:15 PM

This branch was successfully deployed

1 active deployment
staging — c23e7c93 Deployed Oct 31, 2026 by mintlify[bot]
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