Closed wtho closed 2 years ago
0.0.30
Linux 5.18.6, Chromium 103.0.5060.53
18.3.0
Starters / CLI
The global styles should be applied, in both, DEV and SSR builds
The styles are never added to the websites. They only seem to be applied when loaded e. g. via useStyles$.
A workaround seems to add the styles to a component$ using useStyles$, which is also how it currently works in the packages/docs project:
component$
useStyles$
packages/docs
import styles from '../../global.css'; import { component$, useStyles$ } from '@builder.io/qwik' export const App = component$(() => { useStyles$(styles) // [...] })
Related (were closed although not solved, this issue is now the follow-up):
I hope this time we will be able to fix it before closing it prematurely!
npm init qwik@latest
qwik-app
Starter
Setup later
Prettier
cd qwik-app
npm install
npm start
html { background-color: red }
global.css
localhost:3000
I think it works now if the CSS module is included in the entry module, in my case entry.ssr.tsx or entry.dev.tsx. If it is included in root.tsx or app.tsx, it does not work.
entry.ssr.tsx
entry.dev.tsx
root.tsx
app.tsx
fixed by https://github.com/BuilderIO/qwik/commit/1dcf329a1b7654e56642e7bac26e4610073ebe12
Qwik Version
0.0.30
Operating System (or Browser)
Linux 5.18.6, Chromium 103.0.5060.53
Node Version (if applicable)
18.3.0
Which component is affected?
Starters / CLI
Expected Behaviour
The global styles should be applied, in both, DEV and SSR builds
Actual Behaviour
The styles are never added to the websites. They only seem to be applied when loaded e. g. via useStyles$.
Additional Information
A workaround seems to add the styles to a
component$
usinguseStyles$
, which is also how it currently works in thepackages/docs
project:Related (were closed although not solved, this issue is now the follow-up):
I hope this time we will be able to fix it before closing it prematurely!
Reproduction
npm init qwik@latest
qwik-app
Starter
Setup later
Prettier
cd qwik-app
npm install
npm start
html { background-color: red }
toglobal.css
localhost:3000
- no red background visible, rule not applied :sad