question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Production Build Stripping Important Parentheses from CSS

See original GitHub issue

Describe the bug

Some parentheses in CSS is being incorrectly stripped out, changes meaning completely due to incorrect order of operations

Did you try recovering your dependencies?

yes

Which terms did you search for in User Guide?

parentheses, strip, css

Environment

System: OS: Linux 5.4 Arch Linux CPU: (8) x64 Intel® Core™ i7-7700K CPU @ 4.20GHz Binaries: Node: 13.6.0 - /usr/bin/node Yarn: 1.21.1 - /usr/bin/yarn npm: 6.13.6 - /usr/bin/npm Browsers: Chrome: Not Found Firefox: 72.0.1 npmPackages: react: Not Found react-dom: Not Found react-scripts: Not Found npmGlobalPackages: create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

  1. import the following css:
  body .chat-wrapper {
    padding: 0 calc(((100vw - 1140px) / 2) - (1.5rem + 24px));
  }
  1. run build

Expected behavior

the parentheses are kept because they are semantically different than without them

Actual behavior

the css is compiled to: body .chat-wrapper{max-width:100vw;padding:0 calc((100vw - 1140px)/2 - 1.5rem + 24px)} (missing required parentheses around 1.5rem + 24px)

Reproducible demo

https://github.com/SampsonCrowley/css-bug-demo

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
rflmykcommented, May 11, 2020

It’s happen on develop env as well, take a look:

On source:

    flex: 0 0 calc(var(--grid-column) * 2);
    max-width: 16.66667%;
    max-width: calc(var(--grid-column) * 2);

After compile:

    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: calc(var(--grid-column);
    max-width: 16.66667%;
    max-width: calc(var(--grid-column) * 2)

Someone have idea how fix it?

0reactions
stale[bot]commented, Jun 17, 2020

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Obsessive CSS Code Formatting: Opening and Closing ...
So, to continue the conversation, let's explore several techniques for writing the opening and closing brackets of CSS declaration blocks.
Read more >
Eliminating Unused CSS - SurviveJS
It walks through your code and figures out which CSS classes are being used as often there is enough information for it to...
Read more >
Cloning background image with parenthesis in file name
The problem comes when I try to use jquery's clone function. Apparently, the output after clone() does not recognize the above image url...
Read more >
Expandable Sections Within a CSS Grid
I'm quite comfortable wrangling CSS Grid to produce interesting layouts, while keeping the HTML markup clean and simple.
Read more >
Style lost when using "aggregate and compress css files".
I have built a custom theme using zen. For my image galleries, I have code in the "fields.css" file for my theme, to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found