I have an existing Astro component that already includes some classes in its template; however I'm trying to reuse this component on a different view and change the color of its header only on that view.
So I read the docs saying that I can pass a class
prop to add classes from a parent to a child; however, I'm not understanding how can I keep the existing classes in the component and just override something or add another class to the already existing ones.
<ExpansionQuestion question={question.question}>
<Fragment slot="body" set:html={question.answer} />
</ExpansionQuestion>
ExpansionQuestion
root element:
<details
class="group bg-blue-gray duration-300 rounded-lg p-4 w-full shadow-md focus:outline-none focus:ring-0"
>
I just want to add a different bg-secondary
class to the details
element on one specific view, the rest of the classes should stay the same everywhere.
Is it possible to do this?