Jackardios / css-to-tailwindcss

Convert CSS to TailwindCSS 3.x
MIT License
114 stars 14 forks source link

Fails with border shorthand when it's missing border-width value (and others) #26

Open guivr opened 1 month ago

guivr commented 1 month ago

Current Behavior

td {
  border: solid rgba(148, 163, 184, 0.1);
}

is converting to:

td {
  @apply border-[solid] border-[163,184,0.1)];
}

The way border shorthand is being converted, it's always expecting a perfect value, in order, and nothing missing: width style color. But sometimes border doesn't come with width, or style, or color - and it's still valid CSS. Or it could be on a completely different order, like color width style.

Expected Behavior

td {
  @apply border-solid border-[rgba(148,163,184,0.1)];
}

(This issue is now fixed. I'm just creating it so that I can reference it in the Pull Request).