how in jsx react styles connected? like when i do import styles from…
- User
how in jsx react styles connected?
like when i do import styles from 'styles.module.scss';
and then do
it is connected to style file .container
but what if i want in style file .author-image css class, how to apply it in jsx? styles.authorContainer not working
- Assistant
In a React application using CSS modules, the way you reference CSS classes depends on how they are named and organized in your style file.
Let's clarify the process step-by-step:
-
Importing Styles: You correctly import your styles from a SCSS (or CSS) module like this:
jsximport styles from 'styles.module.scss'; -
: When you use , you are correctly accessing a CSS class defined in your SCSS module.
-