Next.js Discord

Discord Forum

combine classes from module styles and global styles in same element?

Answered
Spectacled bear posted this in #help-forum
Open in Discord
Spectacled bearOP
So, the Docs state the following methods of adding classes for styling in JSX:

Global styles:
className="container"


Modules:
className={styles.dashboard}

what if I want to use both for 1 component?
Answered by Clown
{styles.dashboard} just returns a class's name.

You can do some string concat/interpolation:

{"container " + styles.dashboard}
View full answer

4 Replies

Answer
Make sure to add that space after container.
Spectacled bearOP
ah ok, thanks, imma try and reply here if any issues arise
welp thankyou very verymuch ❤️ u da bomb