arlyon / stailwc

Tailwind in SWC, Nextjs, and Vite, fast 🚀
https://npmjs.com/package/stailwc
Apache License 2.0
230 stars 3 forks source link

`grid-flow-col` doesn't work as expected #29

Closed henninghall closed 1 year ago

henninghall commented 1 year ago

Hi, thanks for a great tool.

I've tried to migrate from twin.macro and noticed an issue with grid-flow-col. It doesn't seem to be applied and works differently compared to twin.macro and className.

Using styled-components compiler.

Difference:

Screenshot 2023-02-18 at 21 35 32
 <div tw="grid grid-cols-3 gap-1">
      <b></b>
      <b>className</b>
      <b>tw (stailwc)</b>
      <div>
        <div>grid grid-cols-3</div>
      </div>
      <div tw="bg-blue-200">
        <div className="grid grid-cols-3">
          <div>A</div>
          <div>B</div>
          <div>C</div>
        </div>
      </div>
      <div tw="bg-red-200">
        <div tw="grid grid-cols-3">
          <div>A</div>
          <div>B</div>
          <div>C</div>
        </div>
      </div>
      <div>
        <div>grid grid-flow-col</div>
      </div>
      <div tw="bg-blue-200">
        <div className="grid grid-flow-col">
          <div>A</div>
          <div>B</div>
          <div>C</div>
        </div>
      </div>
      <div tw="bg-red-200">
        <div tw="grid grid-flow-col">
          <div>A</div>
          <div>B</div>
          <div>C</div>
        </div>
      </div>
    </div>
arlyon commented 1 year ago

Thanks for the report! I'll have a look today.

arlyon commented 1 year ago

Please check out https://github.com/arlyon/stailwc/releases/tag/0.15.0 which should have much better coverage of the grid APIs (read: all :) )

(Particularly this line https://github.com/arlyon/stailwc/commit/1b961698faf84694e53cd23b21994303c7e6311e#diff-d11d6d15048f23132dd049d7da13b0d307c94821aa6ff08f590ff31a8afac8d9R107)

If you would like to verify the coverage, you can check it by running cargo test -- --include-ignored. This runs agains twin.macro's test suite. The coverage reported is actually lower that reality as it reports a success only when an entire file passes, rather than per-rule. I would estimate about 70% coverage at the moment, with the remaining 30% being stuff I rarely use. However, I aim for a turnaround time of a few days in most cases for missing stuff so feel free to open more issues :)

henninghall commented 1 year ago

Thats great! looking forward to the release 🚀

henninghall commented 1 year ago

I can confirm that this now works in 0.15.0 🎉