Skip to content

The space before the "-" is missing when using CSS variables #233

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

Closed
Eoyo opened this issue Jun 8, 2020 · 3 comments · Fixed by #436
Closed

The space before the "-" is missing when using CSS variables #233

Eoyo opened this issue Jun 8, 2020 · 3 comments · Fixed by #436

Comments

@Eoyo
Copy link

Eoyo commented Jun 8, 2020

TypeScript before transform:

  declare const styled: any;
  const ValueCalc = styled.div \`
    height: calc(var(--line-height) - 5px);
    width: calc(100% - 5px);
  \`;
  

TypeScript after transform:

  declare const styled: any;
  const ValueCalc = styled.div \`height:calc(var(--line-height)- 5px);width:calc(100% - 5px);\`;
  

There is no problem when using only the calc method, but there is a bug when combined with the var method. Browser can't parse missing spaces before '-'

@Igorbek Igorbek added this to the Release 1.6 milestone Apr 7, 2021
@Igorbek
Copy link
Owner

Igorbek commented Apr 7, 2021

@Eoyo

  const ValueCalc = styled.div \`height:calc(var(--line-height)- 5px);width:calc(100% - 5px);\`;
//                                                             ^ is the space missing in this position?

@Sealarn
Copy link

Sealarn commented Jun 30, 2021

I have the same issue.

 --padding-button: calc(var(--padding-button-vertical)- 2px) calc(var(--padding-button-horizontal)- 2px);
                                                      ^                                           ^

@Igorbek
Copy link
Owner

Igorbek commented Jul 9, 2021

@Eoyo @Sealarn it's now been fixed and released in 2.0.0, see the announcement #440

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