-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Sass preprocessor and CSS modules not working #65
Comments
Hi @tiagoporto! Have you already seen the Global CSS section in https://viteshot.com/docs/config/css#global-css? |
Hi @fwouts , yeap. It's not my case I dont have any Global CSS. Giving a short example. // Component.scss
.button {
background: red,
} import styles from 'Component.scss'
export const Component = () => {
return <button className={styles.button}>Text</button>
} Styles from |
Shouldn't the import be |
Ohh sorry, yes. |
Just confirming is there also a syntax error in the SCSS example with the comma instead of semicolon? :) .button {
// background: red,
background: red;
} |
Hi @fwouts, Let me update the example, you could ignore the syntax because I'm sure that styles are working in the application. // Component.module.scss
.button {
background: red;
} import styles from 'Component.module.scss'
export const Component = () => {
return <button className={styles.button}>Text</button>
} This is my component in the application, there is no global CSS, all the styles are in the This is the screenshot I did a test removing SASS and CSS modules and everything works, but using SASS and CSS modules not. |
Hi @tiagoporto, I've been unable to reproduce this issue. I did just notice that your config uses If you have a minimal repro to share, I'd appreciate it! |
Hi @fwouts, thanks to refer to this library in fwouts/react-screenshot-test#34.
The styles from my component is not being used. My guess is that SASS and CSS modules is being ignored.
Is there some example to configure that?
I'm reading the documentation for vite and seems that CSS module and SASS is already supported.
https://vitejs.dev/guide/features.html#css-modules
I tryed
Thank you
The text was updated successfully, but these errors were encountered: