Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore Tailwind's native spacing scale #22

Merged
merged 2 commits into from
Mar 14, 2025

Conversation

williamneves
Copy link
Contributor

Problem

The preset currently overwrites Tailwind's default spacing system by mapping the base spacing unit to Mantine's --mantine-spacing-md (1rem). This breaks the expected behavior of Tailwind's utility classes:

  • Standard Tailwind: p-1 = 0.25rem, p-2 = 0.5rem, p-3 = 0.75rem
  • Current preset: p-1 = 1rem, p-2 = 2rem, p-3 = 3rem

This large jump between spacing increments makes it difficult to create fine-tuned layouts and breaks compatibility with existing Tailwind projects.

Solution

This PR removes the --spacing: var(--mantine-spacing-md) line from all relevant files, restoring Tailwind's native spacing scale with 0.25rem increments while preserving all other Mantine design tokens.

Benefits

  • Maintains backward compatibility with standard Tailwind spacing
  • Allows for more precise layout control with finer spacing increments
  • Reduces friction for teams migrating existing Tailwind projects
  • Still provides access to Mantine's named spacing variables when needed

This change ensures the best of both worlds: Mantine's design system with Tailwind's intuitive spacing scale.

@songkeys songkeys merged commit 041aa4c into songkeys:main Mar 14, 2025
@songkeys
Copy link
Owner

Thank you!

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