grav-plugin-shortcode-core icon indicating copy to clipboard operation
grav-plugin-shortcode-core copied to clipboard

[FEATURE] Implement open state and group mode for details shortcode

Open schliflo opened this issue 6 years ago • 4 comments

This enables users to manually set details to open.

Additionally via group mode, you can group items to achieve real accordion like behaviour.

schliflo avatar Oct 19 '19 15:10 schliflo

Details is supposed to be a simple 'javascript' free solution. It seems you are trying to implement an accordion, which already has an open state and is by default 'grouped'. Is there a reason you are trying to make 'details' behave like 'accordion' ?

rhukster avatar Dec 19 '19 17:12 rhukster

That's exactly what I'm trying to do. I'd be happy to reduce the PR to only implement the configurable open state - which should be configurable even if it's not used as an accordion.

schliflo avatar Dec 19 '19 17:12 schliflo

OK, I get it, as this is a more 'accessible' accordion solution, might it not be better to use aria attributes rather than data attributes?

rhukster avatar Dec 19 '19 17:12 rhukster

Just found this: https://www.scottohara.me/blog/2018/09/03/details-and-summary.html which is basically exactly what you are trying to do?

rhukster avatar Dec 19 '19 17:12 rhukster