Search code examples
reactjsstyled-componentsreact-dates

Using Styled Components, is there a way to select a className


I am using StyledComponents in a React project, and I'm planning to overwriting the styles in Airbnb's react-dates library. They are using a CSS file with classes, but I want to overwrite their CSS using a wrapper component through StyledComponents (to keep my project consistent with not using CSS files).

Is this possible? I'm not finding anything on it.


Solution

  • Try to be as specific as possible and if necessary add the !important flag.

    For example:

    #TheID .theClassName .otherDIV .someDIV .divDIV .divitisDIV { color: purple!important; }