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.

Previous sibling selectors incorrectly parsed without whitespace

See original GitHub issue

I have browser compliant mode turned on and the following CSS is incorrectly parsed:

div+p .foo{width:100vw}

But the following works fine

div + p .foo{width:100vw}

But it seems like when you ask for optimized output for div + p .foo{width: 100vw} you get div+p .foo{width:100vw} which means those rules don’t roundtrip properly? It seems to handle ~ and > correctly however?

The error message says:

Was expecting one of:

    "*"
    "."
    ":"
    ":not("
    "@bottom-center"
    "@bottom-left"
    "@bottom-left-corner"
    "@bottom-right"
    "@bottom-right-corner"
    "@charset"
    "@footnote"
    "@import"
    "@left-bottom"
    "@left-middle"
    "@left-top"
    "@media"
    "@namespace"
    "@page"
    "@right-bottom"
    "@right-middle"
    "@right-top"
    "@supports"
    "@top-center"
    "@top-left"
    "@top-left-corner"
    "@top-right"
    "@top-right-corner"
    "["
    "|"
    "}"
    <AT_UNKNOWN>
    <FONTFACE_SYM>
    <HASH>
    <IDENT>
    <KEYFRAMES_SYM>
    <PERCENTAGE>
    <S>
    <VIEWPORT_SYM>

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
phaxcommented, Mar 30, 2022

Thanks for the swift response - levaing this one open for now

0reactions
rockwotjcommented, Mar 30, 2022

Not anytime soon unfortunately 😔

Read more comments on GitHub >

github_iconTop Results From Across the Web

How whitespace is handled by HTML, CSS, and in the DOM
Most whitespace characters are ignored, not all of them are. In the earlier example one of the spaces between "Hello" and "World!
Read more >
There is no parent and before sibling css selector so what I'm ...
I want to change css of div when a is hovered . Div have to be before a and there is no selector...
Read more >
Selectors Level 4 - W3C
Note: As whitespace represents the descendant combinator, no whitespace is allowed between the simple selectors in a compound selector.
Read more >
Fighting the Space Between Inline Block Elements | CSS-Tricks
A series of inline-block elements with "normal" HTML formatting result in spaces between them when set on the same line.
Read more >
Safari Technology Preview Release Notes - Apple Developer
commitStyles() not changing the style attribute for individual CSS transform ... Changed to not detach whitespace nodes when the previous sibling is an ......
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