-
1. Create a file named the same as the component where you are using the CSS styling as shown: `COMPONENT_NAME.module.css`.
-
- Then, add the desired styling to the file.
-
- When ready to add the styling to the component, import the CSS module and use in
className
prop.
-
import styles from "./COMPONENT_NAME.module.css" const COMPONENT_NAME = () => { return ( <div className={styles.awesomeStyling}> Styled container </div> ); }; export default COMPONENT_NAME;
- When ready to add the styling to the component, import the CSS module and use in
-
- TODO Implementing a page SVG styling with [[CSS]] modules in [[Nextjs]]
- The site I used to generate a custom SVG shape
-
1. Add the HTML to the React component
-
- Create a
COMPONENT_NAME.module.css
file and add the generated CSS.
- Create a
-
- Use
className
instead ofclass
, and customize the naming of the classes to fit your use case.
- Use
-
import styles from "./COMPONENT_NAME.module.css";
and useclassName={styles.CSS_CLASS_NAME}
as your div's prop.
-
- Add a
z-index: -1
tag in the CSS class if needed to send shape to the background
- Add a
-