官术网_书友最值得收藏!

Shadow DOM

This part of the web components specification was the missing piece to create proper DOM encapsulation and composition. With shadow DOM, we can create isolated parts of the DOM that are protected against regular DOM operations from the outside. Also, CSS will not reach into shadow DOM automatically, and we can create local CSS within our component.

If you add a style tag inside shadow DOM, the styles are scoped to the root within the shadow DOM, and they will not leak outside. This enables a very strong encapsulation for CSS.

Content insertion points make it easy to control content from the outside of a shadow DOM component, and they provide some kind of an interface to pass in content.

At the time of writing this book, shadow DOM is supported by most browsers, although it still needs to be enabled in Firefox.

主站蜘蛛池模板: 鹤岗市| 贵德县| 承德市| 达拉特旗| 沁水县| 江津市| 孝昌县| 罗平县| 克山县| 德庆县| 鸡泽县| 台江县| 克东县| 饶河县| 湾仔区| 油尖旺区| 丽江市| 武陟县| 鄱阳县| 广河县| 霍邱县| 翁牛特旗| 霍林郭勒市| 石渠县| 祁东县| 舒兰市| 屏东县| 东安县| 巴林右旗| 合水县| 宁化县| 伊春市| 方正县| 四会市| 合川市| 金塔县| 尚义县| 周宁县| 慈溪市| 高阳县| 龙海市|