Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to style dropdown options with CSS modules #229

Open
azakero opened this issue Oct 12, 2021 · 1 comment
Open

Unable to style dropdown options with CSS modules #229

azakero opened this issue Oct 12, 2021 · 1 comment

Comments

@azakero
Copy link

azakero commented Oct 12, 2021

Hi. Thanks so much for an amazing library.

However, I'm having an issue. My app uses CSS modules and I'm not sure if this library supports it for dropdown options. I could style everything else but dropdown options doesn't seem to work.

I can see the class name in the html but not in the style section.

How can I do that?

@michsko544
Copy link

michsko544 commented Apr 7, 2022

You can simply do it with css selectors, like this:

.dropdownMenu {
   // class for menuClassName

    & > * {
      padding: 4px 8px;
      border-radius: 2px;
      transition: $transition-time background-color;
      cursor: pointer;

      &:hover {
        background-color: $color-hover;
      }

      &[class*='is-selected'] {
        background-color: $color-primary;
        color: $color-white;
      }
    }
  }

*This is written in SCSS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants