Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript error with lighten and cssVar #571

Open
EnesAppsmen opened this issue Mar 22, 2021 · 2 comments
Open

Typescript error with lighten and cssVar #571

EnesAppsmen opened this issue Mar 22, 2021 · 2 comments
Labels

Comments

@EnesAppsmen
Copy link

  • polished version:
  • JSS-in_CSS library and version:
  • Any relevant JS library and version:

Mixin/Helper/Shorthand Usage

What You Are Seeing

download

What You Expected To See

No typescript error while using lighten and cssVar together

Reproduction

React 17.0.1
Typescript: 4.1.2
Polished: 4.1.1
Styled-components: 5.1.5;

@bhough
Copy link
Contributor

bhough commented Apr 25, 2021

@EnesAppsmen Similar to #550 this is a bug with our Flow > TS library. We will be moving to native TS in v5 and will address this then.

@jlozovei
Copy link

I was facing this error while using TS, but the styles were applying correctly.
Solved the TS error using template literals:

border-color: ${lighten(0.2, `${cssVar('--bg-light'))}; // TS error

border-color: ${lighten(0.2, `${cssVar('--bg-light')}`)}; // fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants