Separate accordion buttons

Topic summary

A user is customizing an accordion footer menu for mobile devices and wants to implement unique open/close indicators for each menu section.

Current Setup:

  • Footer accordion uses “+” and “-” symbols to indicate collapsed/expanded states
  • All menus share the same toggle symbols

Desired Modification:

  • Keep “+” symbol in current position when menus are collapsed
  • Display “0” when first menu opens
  • Display “1” when second menu opens
  • Each accordion section should have its own unique open state indicator

Technical Context:

  • Code includes CSS for mobile viewport (max-width: 749px)
  • Uses ::after pseudo-element with content property for toggle symbols
  • JavaScript handles collapse/expand functionality with ARIA attributes
  • User has experimented with changing the content value but needs guidance on implementing menu-specific indicators
Summarized with AI on November 10. AI used: claude-sonnet-4-5-20250929.

I’m using the code below for an accordion footer. I’ve played around with it and discovered I can change the buttons by changing what the “content” is. How would I make it so each menu can have its open button. Basically the current place of the “+” is fine… how would I make the first menu become “0” when opened and the second menu become “1” when opened. Thank you in advance.

pw: teunto

@media (max-width: 749px) { .grid .footer-block.grid__item { margin: 0; } .grid .footer-block__heading { position: relative; margin: 0; padding: 1.5rem 0; cursor: pointer; } .grid .footer-block__heading::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 20px; text-align: center; } .grid .footer-block__heading:not(.block-collapsed)::after { content: "-"; } .grid .footer-block__heading.block-collapsed + .footer-block__details-content { visibility: hidden; opacity: 0; height: 0; margin: 0; padding: 0; transition: all .2s ease-out; overflow: hidden; } .grid .footer-block__heading + .footer-block__details-content { visibility: visible; opacity: 1; height: auto; transition: all .2s ease-out; overflow: hidden; margin-bottom: 3rem; } }