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

Adapt CLI with changes in TailwindCSS V3 #281

Merged
merged 28 commits into from
Dec 12, 2021
Merged

Adapt CLI with changes in TailwindCSS V3 #281

merged 28 commits into from
Dec 12, 2021

Conversation

muhammadsammy
Copy link
Owner

@muhammadsammy muhammadsammy commented Oct 4, 2021

This PR contains the following:

Tailwind V3 changes:

  • Remove AOT engine, make JIT the default (#5340)
  • Enable extended color palette by default with updated color names (#5384)
  • Move vertical-align values to config file instead of hard-coding (#5487)
  • Rename overflow-clip to text-clip and overflow-ellipsis to text-ellipsis (#5630)

tailwindcss-classnames:

@muhammadsammy muhammadsammy changed the title feat: enable jit features all the time TailwindCSS V3 Oct 16, 2021
@muhammadsammy muhammadsammy changed the title TailwindCSS V3 Adapt CLI with changes in TailwindCSS V3 Oct 16, 2021
cls => '!' + cls,
);
// Duplicate classnames with an important (!) prefix
const generatedClassGroupWithImportantPrefix = generatedClassGroup.map(cls => '!' + cls);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it would improve or worsen perf, but some of the things this lib is doing can be accomplished using template string types:

export type TClassesWithModifiers = `!${TClasses}` | TClasses

This could potentially be used to implement a lot of things in the lib with less code.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I think this will make file size much smaller
Would you like to make a PR with this change to be merged into master for v2 releases?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a shot at it 👍

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm already using Tailwind 3 myself, so I thought maybe I should do the changes on top of this PR. Do you think that would be a good idea?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I've tested this approach on pseudoclasses, and it was extremely slow
But it was OK when applying this approach to important modifiers only

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And yes, it makes more sense to do the changes on top of this PR. Thank you!

@muhammadsammy muhammadsammy linked an issue Oct 23, 2021 that may be closed by this pull request
@muhammadsammy muhammadsammy merged commit 02a3555 into master Dec 12, 2021
@muhammadsammy muhammadsammy deleted the jit-always branch December 12, 2021 11:19
@muhammadsammy muhammadsammy mentioned this pull request Dec 12, 2021
37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants