question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nuxt RC10 - Reset inline styles take priority on built bundle

See original GitHub issue

Environment


  • Operating System: Windows_NT
  • Node Version: v16.15.0
  • Nuxt Version: 3.0.0-rc.10
  • Nitro Version: 0.5.3
  • Package Manager: npm@8.11.0
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

  • With UnoCSS and preflight activated for CSS

Reproduction

See this repo for reproduction : https://github.com/g4w3l/nuxt3rc10-unocss

  • If you launch the server with npm run dev, when you go on /page1 you see a green button as expected
  • If you build it and launch it with
npm run build
node .output/server/index.mjs

The button on /page1 goes transparent

Describe the bug

I’ve put some styles on a button in a component. All works well in dev mode, if you inspect the <button>, the order of the styles is correct and the bg-green is applied : image

In built version the order of the styles is inverted, thus the button is transparent : image

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
markus-gxcommented, Sep 21, 2022

Don’t know if this helps, I had a similar issue which was resolved once I disabled experimental.inlineSSRStyles;

Using tailwind I defined for instance h1 tag like this in my main.scss:

  h1{
    @apply text-[1.75rem] leading-10 md:text-[3.75rem] md:leading-[5.25rem] 2xl:text-3xl font-semibold;
  }

Which worked before RC.10/11. After upgrading every h1 was overridden by default browser styles only when built.

1reaction
AndrewBogdanovTSScommented, Nov 9, 2022

It’s not resolved, moreover inlineSSRStyles now does nothing, it inlines styles incorrectly no matter if it’s true or false, I will prepare repro shortly

Read more comments on GitHub >

github_iconTop Results From Across the Web

The build Property - Nuxt
Nuxt use webpack-bundle-analyzer to let you visualize your bundles and how to optimize them. ... If an object, see available properties here ....
Read more >
Fix List for Db2 Version 11.1 for Linux, UNIX and Windows - IBM
APAR Sev. Abstract IT36427 2 MON_GET_AUTO_MAINT_QUEUE() MAY FAIL WITH SQL0493N IT37394 3 DB2PD ‑BUFFERPOOLS REPORTS INACCURATE HIT RATIO IT36689 2 REORGCHK F6 REPORTING INCORRECT VALUES
Read more >
CSS which takes precedence, inline or the class?
The order of precedence with CSS is as follows: !important (this is a bit hackish though but it is the only way to...
Read more >
Styling with Inline CSS Styles in Vue.js - Coding Explained -
I have added a simple div in advance which is 200 pixels in width and height, and the first thing I want to...
Read more >
Importance of CSS Specificity and its best practices
This slot is affected by inline styles. Any inline style will have precedence over any rule defined in an external CSS file, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found