Closed lhennerley closed 3 years ago
Hi, thanks 😊
See Tailwind’s docs on writing purgeable HTML, it applies to Maizzle too even if we use a custom purging strategy:
https://tailwindcss.com/docs/optimizing-for-production#writing-purgeable-html
Thanks for speedy reply!
I read documentation a bit more after posting. I feel like I am hacking a little bit now that I understand - essentially I am creating a serverless function for sending an email based on some user configuration, the user can choose a color (e.g. blue, red, green etc) and this lives within the loop of list.
For my workaround, I have just looped over every tailwind color in the library and added this to the white list in tailwind config, I am not sure if there is a better way to do this - it seems like the tailwind/purge happens too quickly (e.g. before the variables are replaced). If the purgecss happened after the variables had replaced, there would be "purgeable HTML".
Just a side thought, maybe changing this would break other stuff I don't know but I feel it would give good flexibility for more dynamic rendering like this use case.
Hi - thanks for a superb library! Once you get going it's really powerful. I am trying to render an email with some dynamic css class.
If I run
maizzle serve
approach and build my templates, the following renders fine.If I use the render approach with the following:
It seems like the string itself isn't being parsed in time before it adds the tailwind styles in this scenario, I want to decouple my value from tailwind (e.g. blue rather than
bg-blue-200
) which is the reason for my use case.Any ideas?