How do I change the color of the background and the flashing color of the Skeleton ponent in Material UI ?
I'm trying to set custom styling for them as shown below:
<Skeleton variant="circle" classes={{root:'placeholder-animation'}} animation="wave" width={56} height={56} />
.placeholder-animation{
background: chartreuse;
}
How do I change the color of the background and the flashing color of the Skeleton ponent in Material UI ?
I'm trying to set custom styling for them as shown below:
<Skeleton variant="circle" classes={{root:'placeholder-animation'}} animation="wave" width={56} height={56} />
.placeholder-animation{
background: chartreuse;
}
Share
Improve this question
edited May 21, 2021 at 3:58
crg
4,5783 gold badges38 silver badges68 bronze badges
asked May 20, 2021 at 18:55
Aadhit ShanmugamAadhit Shanmugam
5193 gold badges14 silver badges25 bronze badges
3 Answers
Reset to default 3Material-ui use makeStyles
to override styles with global class names.
Reading the Material-ui doc, it seems that tou have more than one way to go.
You could use makeStyles
to override styles with global class names.
const useStyles = makeStyles({
root: {
background: red,
}
});
...
<Skeleton variant="circle" classes={{root: classes.root}} animation="wave" width={56} height={56} />
Or you could simply use className
<Skeleton variant="circle" className="placeholder-animation" animation="wave" width={56} height={56} />
.placeholder-animation{
background: chartreuse;
}
sx={{"&::after":{background: `linear-gradient( 90deg, transparent, #B4AFA5, transparent)`}}}
You don't need any class to change color of placeholder you can use sudo selector to change color of placeholder check this
::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
color: red;
opacity: 1; /* Firefox */
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: red;
}
::-ms-input-placeholder { /* Microsoft Edge */
color: red;
}
here is working example
::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
color: red;
opacity: 1; /* Firefox */
}
<input type="text" placeholder="Write somthing.">