Skip to content

Loading…

Parsing compressed CSS does not work #1927

Closed
alefwmm opened this Issue · 3 comments

4 participants

@alefwmm

The parser for custom properties does not work for compressed CSS like:

:host{--my-custom-color:#F00;}

When not compressed, it works properly:

:host {
    --my-custom-color: #F00;
}
@YuJM

try

(intdex.html )

  <style is="custom-style">
   :root {
   --my-custom-color:#F00;
   }
  </style>

(your custom-element )

  <style>
    :host{ background-color:var(--my-custom-color);
    }
  </style>
@alefwmm

My bad, I found what the problem really is.
When the last CSS rule is a custom variable and does not have a semi-colon, the problem happens.

This is okay:

:root{--my-custom-color:#F00;}

This is not:

:root{--my-custom-color:#F00}

demo of the bug

@kevinpschaaf kevinpschaaf added 0.5 p2 and removed 0.5 labels
@sorvell sorvell referenced this issue from a commit
@sorvell sorvell Fixes #1938: make host selector not tripped up by id, attr, or pseudo…
… properties

Fixes #1874, #1761: maintain static declarations within declarations that contain custom properties
Fixes #1927: make custom property parser able to see property endings of ; or \n or end token.
ab8c285
@sorvell
Owner

Fixed via #1948

@sorvell sorvell closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.