vite-plugin-pug
vite-plugin-pug copied to clipboard
feat: allow to pass pug locals with <pug> tag using custom attribute
I have the problem that I need to pass a file specific modifier class to the
I would appreciate feedback on the implementation, as I'm not sure if there is a better way.
HTML Code
<pug src="assets/templates/source/04-elements/forms/button.pug" locals="%7B%22modifierClass%22%3A%22btn%20btn--neutral%20btn--wide-max%22%7D" />
Pug File:
button(class=modifierClass) Hello World
Hi, any feedback on this pull request? :)
I think this feature is a good idea as it would make templates more reusable, even if the proposed syntax isn't exactly eye candy. However, the change doesn't pass the tests.