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

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.

主站蜘蛛池模板: 城市| 安多县| 乌拉特中旗| 三穗县| 将乐县| 海南省| 靖远县| 武平县| 堆龙德庆县| 合水县| 通河县| 莱阳市| 曲周县| 甘南县| 盐城市| 武汉市| 锦屏县| 墨脱县| 黄骅市| 屯门区| 河津市| 清苑县| 宣武区| 洛浦县| 云林县| 大埔区| 新昌县| 交城县| 西青区| 弥渡县| 隆回县| 沂南县| 德惠市| 灌南县| 玉龙| 红河县| 六安市| 久治县| 永丰县| 关岭| 玉山县|