-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add documentation for 'id' to accordion component #3789
Conversation
✅ You can preview this change here:
To edit notification comments on pull requests, go to your Netlify site configuration. |
src/components/accordion/index.md
Outdated
@@ -65,6 +65,8 @@ There are 2 ways to use the accordion component. You can use HTML or, if you’r | |||
|
|||
The accordion component uses JavaScript. When JavaScript is not available, users will see all the content displayed with the section labels as headings. | |||
|
|||
The 'id' attribute on the the parent div of the accordion is a required attribute. It must be unique across the domain of your service to persist the expanded state of the accordion (the state individual instances of the component persists across page loads using [session storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to make this into the active voice without changing its meaning? For example - You'll require the 'id' attribute from the parent div of the accordion.
Also, I'm unclear what you mean in the last sentence in brackets.
The 'id' attribute on the the parent div of the accordion is a required attribute. It must be unique across the domain of your service to persist the expanded state of the accordion (the state individual instances of the component persists across page loads using [session storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)). | |
The 'id' attribute on the the parent div of the accordion is a required attribute. It must be unique across the service's domain to maintain the persistent expanded state of the accordion (the state individual instances of the component persists across page loads using [session storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)). |
467b689
to
e7ac344
Compare
src/components/accordion/index.md
Outdated
@@ -65,6 +65,8 @@ There are 2 ways to use the accordion component. You can use HTML or, if you’r | |||
|
|||
The accordion component uses JavaScript. When JavaScript is not available, users will see all the content displayed with the section labels as headings. | |||
|
|||
If you are using HTML, you must add an 'id' attribute to the parent div of the accordion. It must be unique across the service's domain to maintain the persistent expanded state of the accordion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. To be a nuisance, could you add a full stop, please?
e7ac344
to
bd29713
Compare
src/components/accordion/index.md
Outdated
@@ -65,6 +65,8 @@ There are 2 ways to use the accordion component. You can use HTML or, if you’r | |||
|
|||
The accordion component uses JavaScript. When JavaScript is not available, users will see all the content displayed with the section labels as headings. | |||
|
|||
If you are using HTML, you must add an 'id' attribute to the parent div of the accordion. It must be unique across the service's domain to maintain the persistent expanded state of the accordion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion That last one reads nicely 🙌🏻 Wondering if talking about 'parent div' may cause some confusion and lead to people to place that id
on a <div>
wrapping the accordion, rather than the one with the class="accordion"
attribute. I would propose to clarify with either:
If you are using HTML, you must add an 'id' attribute to the parent div of the accordion. It must be unique across the service's domain to maintain the persistent expanded state of the accordion. | |
If you are using HTML, you must add an 'id' attribute to the root `<div>` tag of the accordion. It must be unique across the service's domain to maintain the persistent expanded state of the accordion. |
or
If you are using HTML, you must add an 'id' attribute to the parent div of the accordion. It must be unique across the service's domain to maintain the persistent expanded state of the accordion. | |
If you are using HTML, you must add an 'id' attribute to the `<div>` tag with the `accordion` class. It must be unique across the service's domain to maintain the persistent expanded state of the accordion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense!
The extra documentation for the 'id' attribute that was present in the Nunjucks options table for the accordion has been added to the 'How It Works Section'. This is because if a user is just using the HTML of the accordion component, then they might not encounter the additional documentation provided for the 'id' attribute. This addresses issue #1073.
bd29713
to
e01cb50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that last update! ⛵
What
Add extra documentation for the 'id' attribute to the 'How It Works' section of the accordion component.
Why
if a user is just using the HTML of the accordion component, then they might not encounter the additional documentation provided for the 'id' attribute. This addresses issue #1073.