-
-
Notifications
You must be signed in to change notification settings - Fork 538
[2.0] Flowbite and tailwind to the latest versions #6012
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
base: next-2.0
Are you sure you want to change the base?
[2.0] Flowbite and tailwind to the latest versions #6012
Conversation
…with tailwind v4. Using imports for keeping logical parts separated. Moving the stuff that client should not face to the tailwind-build folder.
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.
Don't forget to document any migration notes. This should be done in 2025-01-15_MigrationTo2
blog post.
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.
All files in tailwind-build
must be in wwwroot
. Otherwise, they will not end in the NuGet package and will not be able to be consumed by the users. I have just tested this by publishing NuGet.
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.
exactly, that's on purpose. users need just the one in wwwroot
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.
And how would they customize tailwind based on our settings?
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.
Same as before. They basically need to replicate our tw build process - with our safelist and input css files + with theirs own rules.
Having the safelist and base css inside nuget package doesn't really help, as these files are usually available through the _content
only during runtime.
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.
God, this is a nightmare to work with. I cannot make TW CLI to work at all. Been trying it all morning.
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.
What's wrong? There is a simple Readme file in tailwind build folder
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.
Something about broswer caniuse.. I've moved to other tasks now. Will try again later.
It seems the class on backdrop should be
instead of
|
Description
Closes #5951
Upgrade to the newest versions of Flowbite and Tailwind.
The Flowbite update now uses v4 of Tailwind. The update was primarily about changing the versions of the JavaScript and CSS files. Everything should be working fine, and I haven’t noticed any issues so far.
Tailwind now has a cleaner way of being included. We no longer distinguish between testing and production—there is now a single
blazorise.tailwind.min.css
file that should be used in both cases. However, for testing purposes, it is still possible to use the Tailwind CDN.Files used exclusively for the build process are now placed in a separate folder to distinguish them from user-facing CSS (in
wwwroot
).Users can still customize Blazorise's Tailwind-related styles to keep their CSS as small as possible. This should also be mentioned in the integration guide.
Safe classes are now stored in a
.txt
file, as Tailwind v4 scans everything by default. There are many invalid Tailwind classes that need correction, such as:!lg:b-5
and similar isn't even valid.b-accordion
and otherb-
prefixed classes will be included via the import ofblazorise.tailwind.css
.I think the safelist and resulting CSS is unnecessary large. We need the safelist just for the "computed" classes, like:
the rest is taken from scanning through the
TailwindClassProvider.cs
. I am not sure how the safe list generation was approached before.The Tailwind demo now uses the production solution (no cdn)
There is a possibility to merge
blazorise.tailwind.min.css
with Flowbite’s CSS to save some kilobytes. Currently:To-Dos: