typewind icon indicating copy to clipboard operation
typewind copied to clipboard

@tailwindcss/@container-queries support

Open zslabs opened this issue 2 years ago • 1 comments

Hi there! It looks like the @tailwindcss/container-queries https://github.com/tailwindlabs/tailwindcss-container-queries plugin may not be supported due to a compilation error with the types. I tried using the Vite example https://typewind.vercel.app/docs/examples/vite

SyntaxError: CssSyntaxError: Unknown word (1:43)
> 1 | .\@container {container-type: inline-size;container-name}

zslabs avatar Jan 25 '23 22:01 zslabs

Container queries plugin isn't working right now because typewind doesn't have a syntax for classes that start with @. Once I've decided on a syntax for that, it will work. For now I can maybe make it ignore this and generate the types for rest if that makes it easier to use

Mokshit06 avatar Jan 26 '23 19:01 Mokshit06

This has been fixed in v0.0.7 https://github.com/Mokshit06/typewind/commit/3d1472f4acc8b563f60e2c1b4c79679b17503bbb. The syntax is:

<div className={tw.$container}>
    <div className={tw.block.$lg(tw.flex)}>
    </div>
</div>

Just replaces @ with $

Mokshit06 avatar Jan 27 '23 20:01 Mokshit06

Very cool, thank you!

zslabs avatar Jan 27 '23 20:01 zslabs

Added to the docs @zslabs!

kavinvalli avatar Jan 27 '23 20:01 kavinvalli