在Web组件之间共享CSS样式 [英] Share CSS styles across web components
本文介绍了在Web组件之间共享CSS样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用应用程序中的Web组件mozilla - X-tabs
对其进行制表.现在,我需要在我的应用程序中使用bootstrap - glyphicons
.但是由于Web组件使用shadow-DOM,引导CSS样式不会应用于Web组件内部吗?
I am using mozilla - X-tabs
, web components in my application for tabbing it. Now, i need to use bootstrap - glyphicons
in my app. But since webcomponents use shadow-DOM, bootstrap css styles are not applied inside web components?
是否有办法为所有Web组件共享一个CSS文件/样式?
Is there a way around it, to share a css file/style for all web components?
推荐答案
您可能想阅读 CSS范围模型.
每个polyfill库(我敢肯定,例如Mozilla都有)为/deep/
,::content
等选择器提供了处理程序.
Each polyfill library (I’m sure, e.g., Mozilla’s does) provides handlers for /deep/
, ::content
etc selectors.
希望有帮助.
这篇关于在Web组件之间共享CSS样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文