softwarecrafts / tailwind-component-classes

Create CSS classes without leaving your tailwind config
8 stars 1 forks source link

Check for conflicts #2

Open nanorepublica opened 2 years ago

nanorepublica commented 2 years ago

While testing the extend/preset examples, I was outputting double the classes. This is not great for file sizes, but also will lead to conflicts and would be unclear as to what is actually going to be rendered.

nanorepublica commented 2 years ago

If we have repeated tailwind classes in a declaration these also get duplicated - not great for readability and file size, but less of an issue since tailwind itself doesn't deal with this I think.

nanorepublica commented 2 years ago

Questions:

  1. Is it possible to dedup an @apply statement? (ie if text colour is declared twice have only the correct one show up)
  2. Is there a way to know if a plugin has already been declared in a preset? (Declaring this plugin in each preset, generates the content twice)
nanorepublica commented 2 years ago
  1. has been solved using the package tailwind-merge
  2. this is still left unsolved, but perhaps it is not something for the plugin to solve