parcel-bundler / parcel-bundler/lightningcss
feat: CSS Modules `[hash]` to include class name
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
Feature request
I'd like to request for the CSS Modules [hash] to include the class name. This would allow cssModules.pattern to be [hash] alone, without needing [local].
Why?
After CSS modularization, I use CSS Modules for these two major benefits:
-
It condenses long, verbose class names into shorter, more manageable ones.
-
It obfuscates class names, helping prevent reverse-engineering tactics, such as crawlers using selectors.
Furthermore, coming from a background of using CSS Modules with Webpack's css-loader, where [hash] generates a hash unique to each class name, I found a slight migration incompatibility with the current implementation in LightningCSS.
P.S. Great work on LightningCSS! It's packed with impressive features that I really appreciate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test path is named. Start by tracing CSS Modules pattern handling and hash generation in LightningCSS, then compare the current behavior with the linked css-loader semantics. Done means [hash] alone produces class-name-specific hashes without requiring [local], with the existing CSS Modules behavior preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, rust
- Domain
- build-system, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100