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

feat(module): add option to disable global css styles #1266

Merged
merged 5 commits into from
Jan 23, 2024

Conversation

cernymatej
Copy link
Contributor

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This pull request introduces an option to disable the global CSS styles injected by the module. The primary motivation for this feature is the ::selection style, which can be quite intrusive on some websites. However, upon considering whether to allow disabling only this specific option, I concluded that it would be more practical to allow the disabling of all styles.

I am of course open to suggestions. 😊

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

vercel bot commented Jan 21, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
ui βœ… Ready (Inspect) Visit Preview Jan 22, 2024 10:43pm

Copy link
Member

Wouldn't it be easier to simply override the ::selection on your end? By disabling those styles you'll break the USelect component and link outlines.

@cernymatej
Copy link
Contributor Author

You could override it but you cannot "unset" it. I'd prefer to keep the browser default rather than providing a custom style.

As for the select component, I didn't notice a difference. However, wouldn't it be better to include the style in the SFC?

@cernymatej
Copy link
Contributor Author

And regarding the link outlines, in my opinion, they are similar to the ::selection styles. A component library should not be overly intrusive, and if it is, it would be nice to have an option to disable it.

benjamincanac added a commit that referenced this pull request Jan 22, 2024
@benjamincanac benjamincanac changed the title feat(config): add an option to disable global css styles feat(module): add option to disable global css styles Jan 22, 2024
Copy link
Member

You're right about the Select, I've moved it!

Copy link
Member

Would you mind adding the option to the docs here: https://github.com/nuxt/ui/blob/dev/docs/content/1.getting-started/2.installation.md#options instead of the theming page?

@MuhammadM1998
Copy link
Contributor

Maybe It's also worth adding the content of ui.css in the docs with/or a link to it? So one can know what styles this option toggles

@cernymatej
Copy link
Contributor Author

Good point with the link to the file. I added it.

@benjamincanac benjamincanac merged commit f96eb5e into nuxt:dev Jan 23, 2024
1 check passed
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.

3 participants