linkedin / linkedin/opticss

Optimization: Remove classes that aren't in the stylesheet.

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
713
Forks
23
PR merge metrics
No merged PRs in 30d

Description

If an element has a classname that isn't in the source stylesheet, that class should be removed by the rewriter.

We can save the classes that are used in only the stylesheets during the `initKnownIdents` initializer and then create `MarkAttributeValueObsolete` actions for the classnames that are never found.

Contributor guide

Open the contributing guide

Research direction

Start at the initKnownIdents initializer and trace how classes used by stylesheets are recorded. Then inspect how the rewriter creates MarkAttributeValueObsolete actions for class names; done means classes absent from the source stylesheets are removed while stylesheet-used classes remain.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
frontend, performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.