覆盖外部组件封装的 CSS [英] Overriding the encapsulated CSS of external component

查看:21
本文介绍了覆盖外部组件封装的 CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何覆盖外部组件的封装 CSS.

I was wondering how to override the encapsulated CSS of an external component.

所以我在我的项目中使用 material2 并且选项卡组件在 <代码>标签正文.是否可以覆盖溢出值?

So I am using material2 in my project and the tabs component has a the attribute overflow set on tab-body. Is it possible to override the overflow value?

推荐答案

您可以使用特殊的 css /deep/ 指令.查看文档

You can use the special css /deep/ instruction. See the documentation

所以,如果你有

app
  sub-component
    target-component
      <div class="target-class">...</div>

您可以在您的应用中放入 css(或更少):

You can put in your apps css (or less):

/deep/ .target-class {
  width: 20px;
  background: #ff0000;
}

显然,您也可以将此 css 片段放在 sub-component 中.

Obviously, you can put this css fragment in sub-component as well.

这篇关于覆盖外部组件封装的 CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆