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

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

问题描述

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

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

所以我在项目中使用 material2 ,并且tabs组件在tab-body.可以覆盖溢出值吗?

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天全站免登陆