如何为 css 样式访问 shadowRoot (Polymer1.0)

How to access shadowRoot for css styling (Polymer1.0)

在 Polymer0.5 中我可以做类似的事情:

domReady: function(){
    print(this.shadowRoot);
}

这将在 shadowRoot 中打印出 html。


当我在 Polymer1.0 中做同样的事情时:

ready: function(){
    print(this.shadowRoot);
}

输出为null


更具体地说,我曾经通过以下方式访问元素 css 属性:

$(this.shadowRoot).find('.some-class').css('height', amount + 'px');

但我正在努力寻找如何在 Polymer1.0 中执行此操作,因为 shadowRoot 为空。

感谢 jdepypere 的提示。原来所有的样式属性都在节点属性.

的样式属性中

所以要调整高度:

Polymer.dom(this.$.scrollArea).node.style.height = '100px';