mirror of
https://github.com/withastro/astro.git
synced 2025-02-10 22:38:53 -05:00
* Fix CSS ordering between imported and Astro styles * Fix linting errors * Add changeset and upgrade compiler version * Update test to reflect shared styles placed before page styles
775 B
775 B
astro |
---|
minor |
Order Astro styles last, to override imported styles
This fixes CSS ordering so that imported styles are placed higher than page/component level styles. This means that if you do:
---
import '../styles/global.css';
---
<style>
body {
background: limegreen;
}
</style>
The <style>
defined in this component will be placed below the imported CSS. When compiled for production this will result in something like this:
/* /src/styles/global.css */
body {
background: blue;
}
/* /src/pages/index.astro */
body:where(.astro-12345) {
background: limegreen;
}
Given Astro's 0-specificity hashing, this change effectively makes it so that Astro styles "win" when they have the same specificity as global styles.