Next.js · Junior · Question 49 of 75
Can you use CSS Modules in Next.js without extra configuration?
- ✓Correct answer: Yes:
*.module.cssfiles are supported out of the box - 2No: you have to install and configure
css-loader - 3Only in the Pages Router; the App Router doesn't support them
Explanation
import styles from './Button.module.css' and className={styles.primary} - class names become locally scoped. Sass (after installing the sass package), Tailwind and global CSS are supported too.