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

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.

主站蜘蛛池模板: 全椒县| 瑞昌市| 鹿泉市| 夏津县| 邓州市| 雷波县| 两当县| 吴桥县| 东海县| 滨海县| 河南省| 华安县| 齐河县| 龙游县| 凌云县| 大邑县| 宁南县| 恩施市| 金乡县| 东城区| 府谷县| 南靖县| 手游| 华安县| 苍溪县| 克山县| 新源县| 常熟市| 松潘县| 新余市| 马山县| 仙居县| 南靖县| 高尔夫| 宣汉县| 九龙坡区| 枣强县| 乳源| 南开区| 夏河县| 渝中区|