I have a 3rd party lib which needs a calendarClassName to modify its style which expect a traditional class name of a CSS class. Can I use styled components to accomplish this?
I tried css function, but it won't work, the result is the array of style rather than a CSS class entity.
Just want to do something like this:
const myStyle = css`color: black`;
<DatePicker calendarClassName={myStyle}> // won't work
Tried attrs without any luck, the className has not been passed down to DatePicker.
const calendarClassName = "calendar";
export const MyDatePicker = styled(DatePicker).attrs({
calendarClassName,
})`
.${calendarClassName} {
border-radius: 0px;
box-shadow: 2px 0px 2.5px #D6D6D6;
border: 1px solid ${color.pacific};
}
`;
I know I can use CSS directly, but I just want to know how to use styled-components to do the job.
Thanks :)