Skip to content
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

inlineSSRStyles breaks styles in terms of specificity in production mode #23785

Closed
unitbjsc opened this issue Oct 19, 2023 · 1 comment · Fixed by #25749
Closed

inlineSSRStyles breaks styles in terms of specificity in production mode #23785

unitbjsc opened this issue Oct 19, 2023 · 1 comment · Fixed by #25749

Comments

@unitbjsc
Copy link

unitbjsc commented Oct 19, 2023

Environment

  • Operating System: Windows_NT
  • Node Version: v18.17.0
  • Nuxt Version: 3.7.4
  • CLI Version: 3.9.0
  • Nitro Version: 2.6.3
  • Package Manager: yarn@1.22.19
  • Builder: -
  • User Config: devtools, css, experimental
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-huboxi?file=package.json,nuxt.config.ts,assets%2Fcss%2Fmain.css

Describe the bug

If inlineSSRStyles in nuxt.config is enabled, the order of files in the 'css' block is not guaranteed. This is only the case if you are in production mode.

In my case I am using normalize.css via npm and a file named main.css.
css: ['normalize.css', '~/assets/css/main.css']

The following config will result in loading my styles first, normalize.css afterwars twice. Once as inline style and once as external style.
image

Additional context

The last version where this was not an issue was 3.5.3

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants