Skip to content

feat(tailwind): prefix font-size tokens with ant-* to avoid overriding built-in rem scale#5

Merged
ayangweb merged 1 commit intomainfrom
copilot/fix-tailwindcss-issues
Apr 27, 2026
Merged

feat(tailwind): prefix font-size tokens with ant-* to avoid overriding built-in rem scale#5
ayangweb merged 1 commit intomainfrom
copilot/fix-tailwindcss-issues

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 27, 2026

The Tailwind plugin registered font-size tokens under bare keys (sm, lg, xl, h1…), silently overriding Tailwind's built-in rem scale — the same collision fixed for UnoCSS in #4.

Changes

  • src/theme.tsbuildFontSizeTheme keys renamed: sm/DEFAULT/lg/xl/h1/h2/h3ant-sm/ant-base/ant-lg/ant-xl/ant-h1/ant-h2/ant-h3
  • src/v4.ts — CSS variable names updated: --text-sm/DEFAULT/lg/…--text-ant-sm/ant-base/ant-lg/…
  • theme.css — Regenerated
  • README.md / README.zh-CN.md — Typography examples updated to text-ant-* utilities

Before / After

<!-- Before: silently overrides Tailwind's built-in text-sm (0.875rem) -->
<p class="text-sm"></p>
<h1 class="text-h1"></h1>

<!-- After: Ant tokens live in their own namespace; built-ins are preserved -->
<p class="text-ant-sm"></p>
<h1 class="text-ant-h1"></h1>

… colliding with built-in rem scale

Agent-Logs-Url: https://github.com/ayangweb/css-plugin/sessions/400f1652-7840-4dac-97dc-d5b4015a4e53

Co-authored-by: ayangweb <75017711+ayangweb@users.noreply.github.com>
@ayangweb ayangweb marked this pull request as ready for review April 27, 2026 09:45
@ayangweb ayangweb merged commit 9455a93 into main Apr 27, 2026
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.

2 participants