linkedin / linkedin/css-blocks

Log error when `compose`-ing on a pseudo element.

Open
#300 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

CSS Blocks should throw an error when trying to use `compose` in a pseudo element.

```css
/* Src Block */
.other-thing { color: red }
/* In another file */
.my-class::before {
composes: "other-thing";
}
```

This doesn't make sense since we will try to apply a class to a pseudo element – which can not receive classes.

Alternative: Inject a new selector that will apply the same code block for pseudos. For example, the above could output:
```css
.other-thing, .my-class::before { color: red; }
```

Contributor guide

Open the contributing guide

Research direction

The issue names no source file, test, or entry point; begin by tracing CSS Blocks handling of `composes` with pseudo-element selectors. Resolve whether the expected outcome is an error or selector injection, then add coverage for the shown example and verify the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.