Open cmbartschat opened 1 year ago
Start a new pull request in StackBlitz Codeflow.
Hi @cmbartschat
I can't reproduce the issue, with the latest version of Qwik, is it still valid?
Hello @cmbartschat. Please provide the missing information requested above.
Issues marked with STATUS-2: missing info
will be automatically closed if they have no activity within 14 days.
Thanks 🙏
The CSS is included twice because you include it twice in two different components.
Although probably the css import should result in the same css qrl somehow.
Here's a repro with the latest qwik.new
We still see the duplicated styles:
The problem goes away if I switch to a shared hook like:
import { useStyles$ } from '@builder.io/qwik';
import styles from './shared-styles.css?inline';
export const useSharedStyles = () => {
useStyles$(styles);
}
Which component is affected?
Qwik Runtime
Describe the bug
The same CSS file is being inlined multiple times.
I have two separate components including the same style.css with
useStyles$
. If I render the same component multiple times, the css file is only included once, but with multiple components, there are duplicate<style>
elements inserted.Reproduction
https://stackblitz.com/edit/qwik-starter-yaczdi
Steps to reproduce
npm run preview
section
elementsSystem Info