cssinjs / cssinjs/jss

Nested function style with prop not working as intended

Open
#1,372 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
7.1k
Forks
386
PR merge metrics
No merged PRs in 30d

Description

__Expected behavior:__
Nested function style should apply props value to the rule, but it has no effect.

__Describe the bug:__

The props in the following function style have no effect on the rules:

```
wrapper: {
"& h1": p => ({
fontSize: p.size,
weight: 900
})
}
```

__Codesandbox link:__
[codesandbox.io](https://codesandbox.io/s/react-jss-playground-wlkbq?file=/index.js)

__Versions (please complete the following information):__
- jss: 10.0.0-alpha
- Browser [e.g. chrome, safari]: chrome
- OS [e.g. Windows, macOS]: Windows

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox reproduction and the nested function style shown in the issue, using JSS 10.0.0-alpha. Trace how the props value is passed to the nested rule and verify the reported h1 properties take effect; done means the reproduction applies the prop-derived rule as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.