ion-icon {
&[size="large"] {
width: 40px;
height: 40px;
}
}
发现可以通过这样编写样式表修改ion-icon的样式
参考ion-icon源码
:host {
display: inline-block;
width: 1em;
height: 1em;
contain: strict;
fill: currentColor;
box-sizing: content-box !important;
}
实际上是应用属性选择器覆盖了下面的修改
(属性选择器参考:属性选择器 - CSS:层叠样式表 | MDN)
:host(.icon-small) {
font-size: 18px !important;
}
:host(.icon-large){
font-size: 32px !important;
}