Skip to content

Parsing compressed CSS does not work #1927

Closed
@alefwmm

Description

@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;
}

Activity

YuJM

YuJM commented on Jun 22, 2015

@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

alefwmm commented on Jun 22, 2015

@alefwmm
Author

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

added a commit that references this issue on Jun 24, 2015

Fixes #1938: make host selector not tripped up by id, attr, or pseudo…

ab8c285
sorvell

sorvell commented on Jun 25, 2015

@sorvell
Contributor

Fixed via #1948

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @sorvell@kevinpschaaf@alefwmm@YuJM

      Issue actions

        Parsing compressed CSS does not work · Issue #1927 · Polymer/polymer