Right now there are 2 components in localgov_base that have CSS and JS:
- add-to-calendar
- prev-next
When the sub-theme uses the localgov_base_remove_css or localgov_base_remove_js theme setting, those components' CSS and JS are not removed.
In regular templates in localgov_base, you have to manually add libraries to get the CSS/JS added to Drupal, so those templates simply check those settings before adding the libraries.
With components, no library definitions are needed. Drupal core's SDC will automatically create a library and auto add the library when the component is used.
That means we need a hook to check the theme settings and then remove the libraries if present.