Struggling to apply a CSS
class to an element from Material-UI:
bw:hover {
-webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
filter: grayscale(100%);
}
Tried using makeStyles
:
import { makeStyles } from '@material-ui/core/styles';
const useStyles = makeStyles({
bw: {
filter: grayscale('100%'),
},
});
Encountered an issue as grayscale
is undefined.
Not seeing the benefits of styling with makeStyles
in Material-UI: syntax changes, missing properties! frustrating!
Decided to override the component style:
Consulted the docs for CardMedia component in Material-UI. Attempted to override the css class of the image tag:.MuiCardMedia-img
, but direct .css file modification failed:
.MuiCardMedia-img:hover {
-webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
filter: grayscale(100%);
}
Seeking clarification, any help appreciated.