accordion markup missing flexibility
See original GitHub issueWith the new accordion markup introduced by https://github.com/ng-bootstrap/ng-bootstrap/pull/2368, it is no longer possible to style the header based on its collapsed/expanded state.
Suppose one wants to add a chevron pointing right for closed and down for opened panes:
This would be appended to the h5
element like this:
h5 {
&:after {
font: normal normal normal 18px/1 FontAwesome;
content: "\f054";
margin-top: 4px;
float: right;
color: white;
}
With the new markup, there is no way to get the collapsed/expanded state at the level where style needs to be applied because it is only represented on the button
child element. In the previous markup, there was a a
element which had the expanded style.
In my view, ng-bootstrap should apply a class at the .card-header
level to allow for such styling.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Stop bootstrap accordion panel collapsing on form submit
I have a form inside a Bootstrap 3 collapsible panel. The form is an asp.net DetailsView control with EDIT and DELETE buttons. When...
Read more >Flexibility in page design - Getting Started - ProcessWire
What I like about Contao is the great flexibility when creating pages/articles - each article is pieced together with content elements (text, ...
Read more >Easy Accordion – Best Accordion FAQ Plugin for WordPress
The best responsive and drag & drop Accordion FAQ builder plugin. User-friendly, Highly Customizable & Intuitive Shortcode Generator.
Read more >A Complete Guide To Accessible Front-End Components
An up-to-date collection of accessible front-end components: accordions, form styles, dark mode, data charts, date pickers, form styles, ...
Read more >Dynamically Adding An Accordion Pane (C#) - Microsoft Learn
The Accordion control in the AJAX Control Toolkit provides multiple ... Add(new LiteralControl("Adding panes using code is really flexible.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Trying to put a button or an anchor with a different action than toggle the content into the title(ngbPanelTitle) does not work in IE11 and firefox because of Content model for button: “Phrasing content, but there must be no interactive content descendant”. Any clue on how to make this work?
I tend to agree with @benouat analysis - the same work-around should be possible with new markup. Please let us know if something is still blocking so we can have a look.
In any case we want to introduce more flexibility for styling / marking up accordion title via existing issues (#465, #717).