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

Simplified utility classes for text, bg, border #3628

Open
XStarlink opened this issue Mar 19, 2025 · 0 comments · May be fixed by #3629
Open

Simplified utility classes for text, bg, border #3628

XStarlink opened this issue Mar 19, 2025 · 0 comments · May be fixed by #3629
Labels
enhancement New feature or request triage v3 #1289

Comments

@XStarlink
Copy link

Description

First of all, thank you for Nuxt UI v3, it's absolutely wonderful! The migration was a bit challenging but now it's a pure joy to use. The new design system with Tailwind V4 CSS variables is brilliant.

Suggestion

While the current system with CSS variables is powerful, writing classes like text-(--ui-text-dimmed) can be a bit verbose. We could provide shorter utility classes that wrap these variables.

Example implementation:

@layer utilities {
  .text-dimmed {
    @apply text-(--ui-text-dimmed);
  }
  
  .text-muted {
    @apply text-(--ui-text-muted);
  }
  
  .text-toned {
    @apply text-(--ui-text-toned);
  }
  
  .text-base {
    @apply text-(--ui-text);
  }
  
  .text-highlighted {
    @apply text-(--ui-text-highlighted);
  }
}

Benefits

  • More concise syntax: text-dimmed vs text-(--ui-text-dimmed)
  • Easier to type and remember
  • Less prone to typos
  • Still leverages the full power of Nuxt UI's theming system
  • Maintains dark mode compatibility out of the box

Would it make sense to include these shorter utilities by default in Nuxt UI?

Additional context

No response

@XStarlink XStarlink added enhancement New feature or request triage v3 #1289 labels Mar 19, 2025
@XStarlink XStarlink changed the title Simplified utility classes for text, bg and borders Simplified utility classes for text, bg, border Mar 19, 2025
@benjamincanac benjamincanac linked a pull request Mar 19, 2025 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage v3 #1289
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant