Skip to content

Tailwindcss grow doesn't work ehn using Vue class binding and props #18578

Answered by wongjn
grshaff asked this question in Help
Discussion options

You must be logged in to vote

I think the working example is a side-effect of how Vue renders "dynamic" HTML (when there are directives) vs "static" HTML.

The rendered HTML of the dynamic HTML looks like:

Compared to static:

Notice how the <article> elements are rendered outside the <a> elements, allowing their grow-* classes to have an effect.

Thus, to achieve a similar effect with class name bindings, add the grow-* and w-* class names to the parent <a> element:

 <template>
     <div class="grow-1 hidden"></div>
-    <a href="">
-      <article class="rounded-xl border-2 border-gray-100 bg-white w-60 mx-0 grow-10 md:grow-12 lg:grow-15 mb-5 @container">
+    <a href="" class="grow-10 md:grow-12 lg:grow-15 w-60 ">
+

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@grshaff
Comment options

@wongjn
Comment options

wongjn Jul 20, 2025
Collaborator

Answer selected by grshaff
@grshaff
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants