- Issue created by @fkildoo
- πΊπΈUnited States fkildoo Alexandria, VA
Here is an update in case anyone is reading this. I ran into further trouble with my theme when updating Drupal to 10.4+, and after some digging, discovered that the uswds.css was overriding my sub-theme CSS, possibly related to " Asset ordering is now more strictly determined by library dependencies β ", which was introduced in v10.4.0.
I solved my issue by editing my libraries.yml file in my sub-theme to add a weight. I also gave a negative weight to the USWDS JavaScript in assets, which fixed issues with the accordion and the gov header. (My USWDS assets are under my-theme/assets.) So now my libraries.yml file looks like this:
uswds_assets: version: 3.10.0 css: theme: assets/uswds/css/uswds.css: {} js: assets/uswds/js/uswds.min.js: {weight: -1} custom: version: 3.10.0 css: theme: css/my-theme.css: {preprocess: false, weight: 1} js: js/my-theme.js: {}
However, adding a weight to JS is discouraged, and it is recommended to use dependencies instead. I tried taking the weight off the JS and adding the dependency on the uswds_assets library to my-theme JavaScript. However, when I did that, I got a nice, fat error: "Failed to open stream: No such file or directory in _locale_parse_js_file()". I've also thought about combining the 2 libraries into one, but not sure that will do anything. For now, I'm sticking with the weight.