Hmm, I don't know enough to give you a confident answer yet. However, I can provide some information about how Astro handles CSS and its cascading order.
Astro evaluates CSS rules in the following order of appearance:
<link> tags in the head (lowest precedence)
- Imported styles
- Scoped styles (highest precedence)
Astro components use scoped styles by default, which means the CSS rules you write inside an Astro component are automatically encapsulated within that component. However, when conflicting CSS rules apply to the same element, browsers first use specificity and then order of appearance to determine which value to show.
In Astro 1.4.0, styles you write in Astro components will come after global styles imported. This means that if you have the same specificity, the one listed later (the one scoped to your component) will prevail.
It's important to note that Astro uses the :where pseudo-selector for scoped Astro component styles, which means your component styles have the same specificity as if they were written in plain CSS. This approach cannot guarantee that component styles will always override global styles.
To better understand the issue you're facing, I recommend reviewing the Astro Styling Guide (https://docs.astro.build/en/guides/styling) and the Astro 1.4.0 Release Blog Post (https://astro.build/blog/astro-140) for more information on how Astro handles CSS and its cascading order.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: