maizzle / framework

Quickly build HTML emails with Tailwind CSS.
https://maizzle.com
MIT License
1.21k stars 48 forks source link

Using props as arbitrary values #1262

Closed de-don closed 3 months ago

de-don commented 3 months ago

If I am using my component props inside template to combine arbitrary class, like max-w-[200px] it not generates tailwind class for that :(

<script props>
  module.exports = {
    width: props.width || "632px",
  };
</script>

<div class="container mx-auto max-w-[{{ width }}]"></div>

It compiles to:

<div class="container mx-auto max-w-[632px]"></div>

but without related styles

cossssmin commented 3 months ago

Tailwind needs to see the entire class name in order to generate the CSS:

https://tailwindcss.com/docs/content-configuration#dynamic-class-names