I am creating a vertical list of navigation topics (buttons) that will drop down when clicked on and reveal subtopics. When I click on the main topic, I want the color of the button to indicate the button is active, however, I also want an isActive indicator for the subtopics if they're clicked on as well. Here's an example of a similar design I would like. 
Long story short: I want the main topic to remain active while I'm clicking throughout the subtopics, but I want those subtopics to change color (indicate they're active) independently of the main topic. How can this be achieved? I am somewhat new to JS and these active states, so any help is appreciated!