-
Notifications
You must be signed in to change notification settings - Fork 96
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
feat(accordion): add two variations of html markup #1990
Conversation
Deploy preview for pf-next ready! Built with commit 45b04ad |
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.
Great work, I'd just add commas to documentation.
@@ -15,11 +21,11 @@ | |||
|
|||
| Class | Applied to | Outcome | | |||
| -- | -- | -- | | |||
| `.pf-c-accordion` | `<dl>` | Initiates an accordion component. **Required**| | |||
| `.pf-c-accordion__toggle` | `<dt><h3><button>` | Initiates a toggle in the accordion. **Required** | | |||
| `.pf-c-accordion` | `<div>` `<dl>` | Initiates an accordion component. **Required**| |
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.
| `.pf-c-accordion` | `<div>` `<dl>` | Initiates an accordion component. **Required**| | |
| `.pf-c-accordion` | `<div>`, `<dl>` | Initiates an accordion component. **Required**| |
| `.pf-c-accordion` | `<dl>` | Initiates an accordion component. **Required**| | ||
| `.pf-c-accordion__toggle` | `<dt><h3><button>` | Initiates a toggle in the accordion. **Required** | | ||
| `.pf-c-accordion` | `<div>` `<dl>` | Initiates an accordion component. **Required**| | ||
| `.pf-c-accordion__toggle` | `<h3><button>` `<dt><button>` | Initiates a toggle in the accordion. **Required** | |
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.
| `.pf-c-accordion__toggle` | `<h3><button>` `<dt><button>` | Initiates a toggle in the accordion. **Required** | | |
| `.pf-c-accordion__toggle` | `<h3><button>`, `<dt><button>` | Initiates a toggle in the accordion. **Required** | |
| `.pf-c-accordion__toggle-text` | `<span>` | Initiates the text inside the toggle. **Required** | | ||
| `.pf-c-accordion__toggle-icon` | `<i>` | Initiates the toggle icon. **Required** | | ||
| `.pf-c-accordion__expanded-content` | `<dd>` | Initiates expanded content. **Must be paired with a button** | | ||
| `.pf-c-accordion__expanded-content` | `<div>` `<dd>` | Initiates expanded content. **Must be paired with a button** | |
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.
| `.pf-c-accordion__expanded-content` | `<div>` `<dd>` | Initiates expanded content. **Must be paired with a button** | | |
| `.pf-c-accordion__expanded-content` | `<div>`, `<dd>` | Initiates expanded content. **Must be paired with a button** | |
Lgtm 👍 |
Thanks for updating this!! Off-thread, @christiemolloy had asked about what the default variation should be, between the one with definition list and one with headings. My understanding with the react component is that if I'm curious what others think, but in this example, I think we can leave the order as it is, and have the react examples updated to match the examples shown in core. Other than that question, there's one minor issue I noticed when I expanded the code for the preview of the
And a similar issue occurs in the example that uses
|
@@ -1,5 +1,11 @@ | |||
## Overview | |||
|
|||
The accordion component can be built in two different ways. | |||
The default way uses `<div>` and `<h3>` tags to build the component. |
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.
Related to my previous comment, I'm not sure that we want to label anything in core as a default, since the concept of defaults doesn't really exist here the way they do in the react repo. In react, there are defaults based on empty props, and for this component, I think the default variation would be the definition list variation.
Here, I would just say that one variation uses definition list and another uses headings. And also that we are using <h3>
but really the heading levels that you use should fit within the rest of the heading outline on your page.
| `.pf-c-accordion` | `<dl>` | Initiates an accordion component. **Required**| | ||
| `.pf-c-accordion__toggle` | `<dt><h3><button>` | Initiates a toggle in the accordion. **Required** | | ||
| `.pf-c-accordion` | `<div>`, `<dl>` | Initiates an accordion component. **Required**| | ||
| `.pf-c-accordion__toggle` | `<h3><button>`, `<dt><button>` | Initiates a toggle in the accordion. **Required** | |
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.
Since this is the only <button>
in the accordion, maybe we can change this:
<h3><button>
, <dt><button>
to just be this:
<button>
One benefit of this is not having to explain that the <h3>
should really be a heading level that fits the rest of the heading outline on your page.
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.
per our offline conversation, updating this to be <h1 - h6>
Updated @jgiardino |
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.
Everything looks good! 🎉 Thanks!
🎉 This PR is included in version 2.16.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
closes #1913