State from semantic attributes
Modern interfaces often expose state through attributes such as aria-expanded, aria-selected or custom data-* attributes. Tailwind can conditionally style elements based on these states.
Accessibility and styling should agree
If a menu is expanded, the controlling button should expose the corresponding ARIA state. Styling should respond to that state rather than creating a separate visual state that can drift out of sync.