-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Style Ordering of Imported Styles is Broken in Dev #6975
Comments
Same issue here. Using Example: setting P.S. This seems to only affect Any updates on this? |
Hello I got the same issue, global tailwind rules are overridden in dev but work in prod Link to sample: https://github.com/herve-ch/astro-tw.git https://melodic-kulfi-ab5aa1.netlify.app => Global styles are applied correctly in prod but not in dev Using astro 2.4.4 |
experiencing the same issue, though for me it doesn't occur on my sites homepage. Both astro and tailwind are on their latest versions. |
Suffering same issue importing Bootstrap styles from npm package, with custom styles in dev only. In prod all styles are imported correctly. In dev the order in which the styles are loaded isn't correct, Bootstrap styles are always loaded after custom styles, so the overrides are never applied. Using 2.3.2. |
This issue is fixed as best as is possible by using scopedStyleStrategy: 'class'. Closing as ordering issues are not fixable. Order can not be guaranteed after bundling. |
What version of
astro
are you using?2.3.4
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
When importing a style reset, such as
normalize.css
, the styles of this reset override all other styles specified in the project, possibly because the order in which style imports are added to the DOM broke or changed.This only happens during dev, after the project is built the styles get applied correctly.
See the linked example for an illustration of the issue. During Dev, the CSS
font-size: 10rem;
is overridden by thefont-size
specified in the importednormalize.css
file, which is unexpected and used to work correctly.After running
npm run build && npm run preview
the size of the heading is correct. (A refresh of the "page" in Stackblitz may be necessary to see the change.)Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-tzsmtu?file=src/pages/index.astro
Participation
The text was updated successfully, but these errors were encountered: