I didn't cover this in my posts but I think a mixin is what you'd want to use in this case. Pug mixins are documented here. If you have troubles figuring out how to make that work, I'd be glad to write up another article showing a scenario similar to yours.
Another alternative would be to just use client-side JavaScript to add/remove CSS classes from your elements.
Did you check out my last post? dev.to/nkratzmeyer/using-mixins-wi...
You can use the implicit attributes of a mixin to set attributes (including classes, id's, etc) on elements inside the mixin.
I created a mixin for the modals (Actually I'm using two with different forms, I pass the params I need and it includes the forms. Even though it would be great if you write another article about it. Thank you.
I didn't cover this in my posts but I think a mixin is what you'd want to use in this case. Pug mixins are documented here. If you have troubles figuring out how to make that work, I'd be glad to write up another article showing a scenario similar to yours.
Another alternative would be to just use client-side JavaScript to add/remove CSS classes from your elements.
Hope that helps!
Take a look. gist.github.com/Rincorpes/2a3f4d6e...
Did you check out my last post?
dev.to/nkratzmeyer/using-mixins-wi...
You can use the implicit attributes of a mixin to set attributes (including classes, id's, etc) on elements inside the mixin.
Yeah! I checked it but when I wrote this I had not read your post. I will implement it following your post. Thank you.
Did it.
I created a mixin for the modals (Actually I'm using two with different forms, I pass the params I need and it includes the forms. Even though it would be great if you write another article about it. Thank you.
Let me see what I can work up!
Done! Its quick & dirty but hopefully you'll find it useful.
Thank you. I'll share with you my solution.
Thank you so much. I'm going to try it. I'll let you know.