ionic 4如何在CSS中更改:shadow dom? [英] ionic 4 how to change :shadow dom in css?

查看:264
本文介绍了ionic 4如何在CSS中更改:shadow dom?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

css问题,在阴影根内部有一个按钮.我需要默认值--padding-top:10px,-padding-end:8px,-padding-bottom:10px,-padding-start:16px,但这是第一个元素,并假定应用了该值如下所示.

css problem with ion-select that has a button inside a shadow root. I need the default value --padding-top:10px,--padding-end:8px,--padding-bottom:10px,--padding-start:16px for this, but it is a first element and assumes the value applied as shown below.

下面的图像包含离子选择的颜色框,无法控制此框的大小.下面是离子选择的代码.有人可以帮我吗?

below image contains color box which is ion-select and unable to control size of this box.code for ion-select is below. Can someone help me?

<ion-col size="2" style="padding:0">
            <div class="colorselect color_{{color.slice(1,7)}}">

                <ion-select >
                  <ion-select-option (ionSelect)="selectColor(optioncolor)" *ngFor="let optioncolor of colors" [value]="optioncolor" >{{optioncolor}}
                  </ion-select-option>
                </ion-select>
            </div>
          </ion-col>

推荐答案

尝试一下.它对我有用

ion-select{
    --padding-top:12px !important;
    --padding-end:12px !important;
    --padding-bottom:12px !important;
    --padding-start:20px !important;
}

这篇关于ionic 4如何在CSS中更改:shadow dom?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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