linkedin / linkedin/css-blocks

mergeDeclarations generate unusable css

Open
#241 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6.3k
Forks
154
PR merge metrics
No merged PRs in 30d

Description

I've cloned examples project from

[Webpack example](https://github.com/linkedin/css-blocks/tree/master/packages/%40css-blocks/webpack/examples)

as basis for my project.

Unfortunatelly when I set `mergeDeclarations` option:

```
const opticssOptions = {
rewriteIdents: true,
mergeDeclarations: true,
removeUnusedStyles: true,
conflictResolution: true,
enabled: true
};
```

resulted css is unusable - classes overlap as if everything would be in global scope, even though I have isolated components.

When I set mergeDeclarations everything renders nicely.

Can someone suggest what am I doing wrong?

This project seemed interesting because of this feature.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue from the linked Webpack example with the shown opticssOptions and inspect the generated CSS. Compare output with mergeDeclarations enabled and disabled, focusing on whether isolated component classes remain distinct. Done means the generated CSS is usable and component isolation is preserved when declarations are merged.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.