Skip to content

feat: allow to pass pug locals with <pug> tag using custom attribute#14

Open
felixranesberger wants to merge 1 commit into
SubZtep:mainfrom
felixranesberger:feature/allow-pug-locals
Open

feat: allow to pass pug locals with <pug> tag using custom attribute#14
felixranesberger wants to merge 1 commit into
SubZtep:mainfrom
felixranesberger:feature/allow-pug-locals

Conversation

@felixranesberger

Copy link
Copy Markdown
Contributor

I have the problem that I need to pass a file specific modifier class to the tag. This pull reqest allows to pass pug locals to individual pug tags via encodeURIComponent strings.

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

@felixranesberger

Copy link
Copy Markdown
Contributor Author

Hi, any feedback on this pull request? :)

@felixranesberger felixranesberger changed the title [FEATURE] Allow to pass pug locals with <pug> tag using custom attribute feat: allow to pass pug locals with <pug> tag using custom attribute Mar 15, 2024
@SubZtep

SubZtep commented Jul 8, 2024

Copy link
Copy Markdown
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants