jantimon / jantimon/css-variable

Linaria - TypeScript problem

Open
#32 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
91
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Hey there,

Using Linaria and the code below:

```ts
import { css } from '@linaria/core';
import { createVar } from 'css-variable';

const myColor = createVar({ value: 'rebeccapurple' });

export const foo = css`
background-color: ${myColor};
`;
```

I get the following error message:

_Argument of type 'CSSVariable' is not assignable to parameter of type 'string | number | CSSProperties | StyledMeta'.
Type 'CSSVariable' is not assignable to type 'CSSProperties'.
Index signature for type 'string' is missing in type 'CSSVariable'._

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the TypeScript error with the issue's Linaria and css-variable snippet. Trace the type accepted by the css template and the CSSVariable returned by createVar; done means the reported compatibility error is resolved and the example type-checks successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.