Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for attributes option #1529

Open
edwardhorsford opened this issue Aug 12, 2019 · 2 comments
Open

Improve documentation for attributes option #1529

edwardhorsford opened this issue Aug 12, 2019 · 2 comments
Labels
documentation User requests new documentation or improvements to existing documentation nunjucks

Comments

@edwardhorsford
Copy link
Contributor

The attributes option on some macros is seemingly very powerful - but I'm not sure the expected format is documented anywhere.

The docs say:
"HTML attributes (for example data attributes) to add to the hint span tag."

As a new user, it would have been helpful to see something that showed the data structure needed - I had to guess it would be an object with keys.

@edwardhorsford
Copy link
Contributor Author

I was hoping to use attributes to set a class on a checkbox item - but I don't think I can because there's already one. Should attributes be merged in? should it mention that there's some stuff you can't set?

@NickColley
Copy link
Contributor

@edwardhorsford I think at this point it'd be easier to consider adding 'classes' to individual items than merging attributes (as this would require Nunjucks global functions), so if you need that feel free to raise a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation User requests new documentation or improvements to existing documentation nunjucks
Projects
None yet
Development

No branches or pull requests

5 participants