cssinjs / cssinjs/styled-jss

Functions do not work with arrays

Open
#22 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
214
Forks
14
PR merge metrics
No merged PRs in 30d

Description

It works:

```jsx
const MyComp = styled('div')({
border: [2, 'solid', 'white'],
});
```
This does not work:

```jsx
const MyComp = styled('div')({
border: ({ children }) => !children && [2, 'solid', 'white'],
});
```

Works:

```jsx
const MyComp = styled('div')({
border: ({ children }) => !children && ['2px', 'solid', 'white'].join(' '),
});
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the two styled('div') examples from the issue and trace how direct style arrays differ from arrays returned by a function-valued style. The issue does not name a source file or test; done means the function form accepts the same array value as the direct form, with coverage for the reported examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.