如何自定义离子风格的组件(不同形状的列表和标签)

How to customize ionic style components (lists and tabs with different shapes)

我试图自定义离子列表和选项卡,但由于我在 css 方面经验不足,有人知道如何获得这些布局吗? :

列表图片:

TABS 图片:

为此,您可以使用带有一些伪元素的边框技巧:

.onecorner,
.twocorners {
  height: 50px;
  width: 300px;
  line-height: 50px;
  text-align: center;
  background: lightgray;
  margin-left: 25px;
  margin-right: 25px;
  position: relative;
}
.onecorner:after{
  content: "";
  position: absolute;
  top: 0;
  left: 100%;
  height:100%;
  width:25px;
  background:inherit;
  }
.onecorner:before,
.twocorners:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-100%);
  width: 0;
  height: 25px;
  border-top: 25px solid transparent;
  border-right: 25px solid lightgray;
}
.twocorners:after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  transform: translateX(100%);
  width: 0;
  height: 25px;
  border-bottom: 25px solid transparent;
  border-left: 25px solid lightgray;
}
<div class="onecorner">tab 1</div>
<br/>
<div class="twocorners">tab 2</div>