Skip to content

[JS Progressive Enhancement] - Use JavaScript with buttons and aria-expanded attributes to toggle on/off side drawers #21

@colinkiama

Description

@colinkiama

For both Sidebar toggle and Table Of Contents Toggle:

  • When JavaScript activates on the page, it will turn the anchor links for the sidebar and table of contents into toggle buttons for drawers
  • Button toggle state is set using aria-expanded attribute
  • Each time the button is pressed, based on the resulting aria-expanded attribute value, classes will also be toggled in the sidebar/table of contents drawer element that will bring the elements into show/hide the drawer
  • Classes will also toggle an overlay that will be displayed in the area outside of the drawer. Clicking on the overlay will turn off the change the toggle state to "false" and update drawer classes to hide drawers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions