-
-
Notifications
You must be signed in to change notification settings - Fork 632
fix: Remove Tailwind dependency from ShadCN package #1964
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
nperez0111
approved these changes
Aug 26, 2025
Contributor
nperez0111
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic, I think this will definitely simplify things for people using ShadCN & keeps our scope down too.
matthewlipski
added a commit
that referenced
this pull request
Aug 28, 2025
* wip * wip * wip * wip * wip * wip * Updated prefix * Removed old import * Updated shadcn styles * Fixed styles * Updated styles and e2e snaps * Simplified config * Cleanup * fix: Remove Tailwind dependency from ShadCN package (#1964) * Removed prefix * Removed Tailwind dependency from ShadCN package * Removed unneeded ShadCN things from playground * Removed `tailwind-merge` dep from playground * Moved tailwind import & shadcn theme from playground to example * Small fix * Fixed docs * Added comments * Small fix * Updated e2e snaps * Updated e2e snaps * Updated ShadCN e2e * Moved tailwind import back to playground and updated docs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a proposal to change the TailwindCSS/ShadCN setup. Currently, we do
@import tailwindcssinstyle.css. This will generate CSS from all of the utility classes that Tailwind detects in the code, and that has multiple issues:bn-prefix)In practice, this doesn't make sense. We expect
@blocknote/shadcnto be used in an app that already uses Tailwind, and probably ShadCN. Therefore, it imo doesn't make sense to include Tailwind at all in the package, and rely on the parent application to have a Tailwind dependency. This way, all of the above issues are resolved.There is one caveat to this - Tailwind only generates CSS based on the utility classes it finds in your code, which is why we previously needed to include that generated CSS in the built files. Since the
@blocknote/shadcnpackage is buried insidenode_modules, Tailwind doesn't check the code there, and there is no way to guarantee that the parent app would use all of the utility classes that BlockNote uses to generate all the necessary CSS. However, Tailwind v4 introduced the@sourcedirective for this exact purpose, so the parent app can now point Tailwind to the code in@blocknote/shadcnand generate all the additional CSS needed.Tailwind utility classes for ShadCN are also no longer in the
@blocknote/shadcnpackage, and the parent app is instead expected to define them. Even if the parent app doesn't use ShadCN and only uses Tailwind, the worst case is that you have to paste some CSS from here.You can see how this works in the playground, which is now solely responsible for importing Tailwind and generating its CSS. It also has the CSS variables and Tailwind classes needed for ShadCN.
TODO:
@blocknote/shadcn