admin管理员组文章数量:1122846
I created a button with a popover like this:
Here is the Vue template code:
<template>
<div :class="['lang-button', { 'in-list': listItem } ]">
<k-button id="lang-button" :raised="!listItem" clear class="py-3 px-3">
<font-awesome-icon icon="earth-americas" class="mr-2" />
{{ $t('common.language') }}
</k-button>
<ion-popover trigger="lang-button" :dismiss-on-select="true">
<ion-content class="lang-button-popover-content">
<ion-list>
<ion-item :button="true" :detail="false" @click="setLanguage('en')">English</ion-item>
<ion-item :button="true" :detail="false" @click="setLanguage('es')">Español</ion-item>
</ion-list>
</ion-content>
</ion-popover>
</div>
</template>
Unfortunately, the last item (Espanol) has a bottom border I want to remove. In Chrome Inspector, I can do it:
It looks better afterwards:
But I'm not able to figure out how to style it in code to do that. I tried:
ion-item::part(native) {
.item-inner {
border-bottom-width: 0;
}
}
and a bunch of other variations, and nothing works. How do you remove style that div.item-inner
to remove that bottom margin?
Thanks.
I created a button with a popover like this:
Here is the Vue template code:
<template>
<div :class="['lang-button', { 'in-list': listItem } ]">
<k-button id="lang-button" :raised="!listItem" clear class="py-3 px-3">
<font-awesome-icon icon="earth-americas" class="mr-2" />
{{ $t('common.language') }}
</k-button>
<ion-popover trigger="lang-button" :dismiss-on-select="true">
<ion-content class="lang-button-popover-content">
<ion-list>
<ion-item :button="true" :detail="false" @click="setLanguage('en')">English</ion-item>
<ion-item :button="true" :detail="false" @click="setLanguage('es')">Español</ion-item>
</ion-list>
</ion-content>
</ion-popover>
</div>
</template>
Unfortunately, the last item (Espanol) has a bottom border I want to remove. In Chrome Inspector, I can do it:
It looks better afterwards:
But I'm not able to figure out how to style it in code to do that. I tried:
ion-item::part(native) {
.item-inner {
border-bottom-width: 0;
}
}
and a bunch of other variations, and nothing works. How do you remove style that div.item-inner
to remove that bottom margin?
Thanks.
Share Improve this question asked yesterday jacobjacob 2,8961 gold badge22 silver badges61 bronze badges 5 |1 Answer
Reset to default 1To fix this issue is as simple as looking at the docs and it shows you how to do this without extra css.
<ion-item lines="none">
<ion-label>Item Lines None</ion-label>
</ion-item>
本文标签: cssHow to style Ionic component using shadow partStack Overflow
版权声明:本文标题:css - How to style Ionic component using shadow part - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736281944a1926485.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
part
can only target the Node it is set on. – Danny '365CSI' Engelman Commented yesterday