Polymer 1.x: How to imperatively (using JS) obtain the value of a custom CSS property?
问题 In the following example, I have a parent custom element calling a child custom element. The child has a variable color CSS property for p elements that can be defined in the parent CSS. In the JS of the child element, I want to read the --custom-color value selected at the parent. In this case, the value is yellow . Put another way: when the getCustomColor() method is run, I want the console log to read "Your custom color is yellow." What JavaScript do I put in the getCustomColor() method to