Support for (S)CSS modules
See original GitHub issueQwik Version
0.0.39
Operating System (or Browser)
chrome 103 on windows 11
Node Version (if applicable)
node 18
Which component is affected?
Qwik Rollup / Vite plugin
Expected Behaviour
If I import a SCSS module like this:
import { component$, Host } from '@builder.io/qwik';
import classes from './greet.module.scss';
export const Greet = component$(() => {
return (
<Host>
<div>Hello <span class={classes.pink}>pink</span>!</div>
</Host>
);
});
The class name should be applied to the DOM element AND the styles should be appended to the page (if sass is installed)
Actual Behaviour
The class name is applied to the DOM element but the styles are not in the page (even if I have sass installed). Regular non-module scss do work though (ie. import “./greet.scss”)
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Documentation about css-modules - GitHub
A CSS Module is a CSS file in which all class names and animation names are scoped locally by default. All URLs (...
Read more >Basic Features: Built-in CSS Support - Next.js
Next.js supports including CSS files as Global CSS or CSS Modules, using `styled-jsx` for CSS-in-JS, or any other CSS-in-JS solution! Learn more here....
Read more >What are CSS Modules and why do we need them?
According to the repo, CSS modules are: CSS files in which all class names and animation names are scoped locally by default. So...
Read more >Component-Scoped Styles with CSS Modules - Gatsby
CSS Modules let you write styles in CSS files but consume them as JavaScript objects for additional processing and safety.
Read more >Support for CSS modules : WEB-17218 - YouTrack - JetBrains
With CSS modules (https://github.com/css-modules/css-modules), you can require CSS files from JavaScript (or similar combinations, e.g. loading SCSS in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@TheKinng96 The thing you’re talking about is unrelated to the issue. The issue described here is related to
CSS modules
(namely, files named*.module.(s)css
. Now the problem is CSS modules seem to only work withCSS
files, but notSCSS
files. Vite out of the box is supposed to handle the compilation from SCSS to CSS, but it seems the styles are processed, because classes created byCSS modules
are added to HTML elements, but the stylesheet is missing, so the classes reference non-existing styles.Yeah, same here. SASS support would be a great addition.