I can't get CSS modules to work in Js - the plain global CSS module file is working, and so are non-specific classes like body are working, however I can't get classes.className to work for example. I'd be glad of some help/ closure. Thanks,
Edit: I don't have an error upon compiling Edit 2: In Dev Tools no classes are shown unless I declare them statically like "className"
import React from "react";
import '.././Index.module.css';
import classes from "./CardLrg.module.css"
function CardLrg(props) {
return (
<div>
<div className={classes.cardLrg}>
<div className={classes.cardLrgHead}>
<div className={classes.cardLrgDiscount}>{props.discount}</div>
<img src="../../public/plus-square.svg" alt="Add to basket"/>
</div>
<div className={classes.cardLrgMainContent}>{props.sku}</div>
</div>
</div>
)
}
export default CardLrg
.cardLrg {
height: 160px;
width: 160px;
border-radius: 10px;
border: 5px solid #000000;
box-shadow: 10px 10px 0px #000000;
position: relative;
background-color: #f7f7f7;
}
console.log(classes)?classes.cardLrgwill beundefined, makes sense why it's not working then?