Friday, April 27, 2018

Re: Using StyleInjector with Polymer and Custom CSS Properties

Made a workaround for this.

Instead of using StyleInjector. I just created a wrapper class that treats it like a mundane style element with loaded innerHTML from the resource:

public interface CSSStuff extends ClientBundle {

public static final PageCSSResources INSTANCE = GWT.create(PageCSSResources.class);

TextResource siteCss();


//...Somewhere else
StyleElement element = Document.get().createStyleElement();        

On Friday, April 27, 2018 at 10:01:11 AM UTC-4, Tyler Moore wrote:
I use StyleInjector to inject CSS rules that work with Shadow DOM Custom Properties:

A snippit from the CSS I inject:

event-action-table.event-action-list-editor {
--table-height: 200px;
-property-with-no-double-minus-prefix: 0;

A snippit from the custom element template:
-grid {
: 100%;
: var(--table-height);

However, at run time, it looks like anything that is prefixed with '--' get's ignored by the injector. In the above case, my output element style looks like:
event-action-table.event-action-list-editor {
-property-with-no-double-minus-prefix: 0;

Why is that?

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment