Some tips found from jQuery theming https://learn.jquery.com/jquery-ui/theming/

Example in Drupal 9

To override the jQuery UI Accordion module’s CSS: 

  1. Declare in your theme’s YML library the same CSS file provided by the module: jquery-ui.theme.css
  2. Copy the same CSS from the module
  3. Override, adjust as needed