I'm trying to learn Gatsby and I'm stuck on using styles from SCSS after I import it on the Homepage.
Here is my Homepage (index.js) that is loading and using SCSS with React JSX.
import * as React from "react"
import styles from '../styles/home.module.scss'
const IndexPage = () => {
return (
<main className={styles.container}>
<h1 className={styles.title}>Helloworld</h1>
</main>
)
}
export default IndexPage
Those are the styles I'm currently trying to import.
.container{
background: purple;
}
.title{
font-size: 5em;
color: white;
}
I'm using SCSS that came automatically installed from Gatbsy, and here is the Config file of Gatsby.
module.exports = {
siteMetadata: {
siteUrl: "https://www.yourdomain.tld",
title: "gatsby-learning",
},
plugins: ["gatsby-plugin-sass"],
};
