Theme and component stylesheets have so far been loaded without a specified order. This causes issues, especially on site with multiple themes that have multiple components each, styles from components would sometimes take precedence over the base theme and other times would override the base theme.
This PR adds an order when outputting theme stylesheets: component themes are displayed first, ordered alphabetically, and then the base theme is output last. This means that styles in the base theme will override styles with the same selector in a component. (In cases where you need a component’s style to override the base theme’s style, make sure the component uses a more specific selector.)
This PR also removes an extra layer of caching. We cache the full array of stylesheets for a specific target, and we also cached each stylesheet path. The PR removes the latter, the full array should be sufficient.