JedWatson / JedWatson/react-select

CSS modules not being loaded when classes have hashes

Open
#5,292 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue/bug-unconfirmed
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

Hello, in the project I'm working on we're using ComponentName.modules.css files for modular styling, with no preprocessors, and so far I've been trying to have the same work with react-select without success. Apparently it doesn't recognize classes with hashes out of the box, so the properties "className" and "classNamePrefix" haven't been working as intended.

Is there any workaround that doesn't involve using a preprocessor, the style API, applying the styles to :global (which defeats the purpose of using CSS modules in the first place) or using ComponentName.styles.css (which also defeats the purpose)? We'd like to keep using CSS modules to keep the project organization consistent for future documentation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with react-select, ComponentName.modules.css, and hashed CSS-module classes, focusing on the className and classNamePrefix entry points. Compare the behavior with the documented styling alternatives and define completion as CSS modules working without a preprocessor, style API, :global, or ComponentName.styles.css.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.