Polymer / polymer

Our original Web Component library.
https://polymer-library.polymer-project.org/
BSD 3-Clause "New" or "Revised" License
22.04k stars 2.01k forks source link

Polymer 3 - JS style object incorrectly showing "" for all style attributes #5547

Closed dman777 closed 5 years ago

dman777 commented 5 years ago

Browsers Affected

Using Polymer 3.... I have .image-slider { left: 5px; } on <div class="image-slider"></div> which is styled correctly. And the style shows correctly in element inspector of dev console. But with const el = this.shadowRoot.querySelector('.image-slider'); and console.log(el.style.left) it does not show a value for left....just left: "". It grabs the element successfully, but it does not reflect the CSS attributes correctly. If fact, all the CSS attributes are showing "" on the style object.

Is this a bug in Polymer 3?

dman777 commented 5 years ago

My bad, did not realize style object only reflects in line style