antd-mobile
Version:
基于 React 的移动设计规范实现
180 lines (177 loc) • 4.6 kB
text/less
@import '../../style/mixins';
@import '../../style/themes/default';
@listPrefixCls: am-list;
.@{listPrefixCls} {
& &-header {
padding: @v-spacing-lg @h-spacing-lg @v-spacing-md @h-spacing-lg;
font-size: @font-size-base;
color: @color-text-caption;
display: inline-block;
width: 100%;
box-sizing: border-box;
}
& &-footer {
padding: @v-spacing-md @h-spacing-lg @v-spacing-lg @h-spacing-lg;
font-size: @font-size-base;
color: @color-text-caption;
}
& &-body {
position: relative;
background-color: @fill-base;
.hairline-top(@list-body-border-color, @list-body-border-width);
.hairline-bottom(@list-body-border-color, 0, @list-body-border-width);
}
}
.@{listPrefixCls}-item {
position: relative;
display: flex;
padding-left: @h-spacing-lg;
min-height: @list-item-height;
background-color: @fill-base;
// box-sizing: content-box;
vertical-align: middle;
overflow: hidden;
.box-align;
transition: background-color 200ms;
&.@{listPrefixCls}-item-top {
.@{listPrefixCls}-line {
.box-align(flex-start);
.@{listPrefixCls}-arrow {
margin-top: 4px;
}
}
}
&.@{listPrefixCls}-item-middle {
.@{listPrefixCls}-line {
.box-align(center);
}
}
&.@{listPrefixCls}-item-bottom {
.@{listPrefixCls}-line {
.box-align(flex-end);
}
}
&.@{listPrefixCls}-item-error {
.@{listPrefixCls}-line {
.@{listPrefixCls}-extra {
color: #f50;
.@{listPrefixCls}-brief {
color: #f50;
}
}
}
}
&.@{listPrefixCls}-item-hover {
background-color: @fill-tap;
}
img {
width: @icon-size-md;
height: @icon-size-md;
vertical-align: middle;
}
/* list左图片显示*/
.@{listPrefixCls}-thumb {
&:first-child {
margin-right: @h-spacing-lg;
}
&:last-child {
margin-left: @h-spacing-md;
}
}
.@{listPrefixCls}-line {
position: relative;
display: flex;
flex: 1;
align-self: stretch;
padding-right: @h-spacing-lg;
min-height: @list-item-height;
overflow: hidden;
.hairline-bottom(@border-color-base);
/* list左侧主内容*/
.@{listPrefixCls}-content {
flex: 1;
color: @color-text-base;
font-size: @font-size-heading;
line-height: 1.2;
text-align: left;
.ellipsis();
padding-top: 14px;
padding-bottom: 14px;
}
/* list右补充内容*/
.@{listPrefixCls}-extra {
flex: 1;
color: @color-text-caption;
font-size: @font-size-heading;
line-height: 1.2;
text-align: right;
.ellipsis();
padding-top: 14px;
padding-bottom: 14px;
}
.@{listPrefixCls}-title {
.ellipsis();
}
/* 辅助性文字*/
.@{listPrefixCls}-brief {
color: @color-text-caption;
font-size: @font-size-subhead;
line-height: 1.2;
margin-top: @v-spacing-sm;
.ellipsis();
}
/* list右侧箭头*/
.@{listPrefixCls}-arrow {
display: block;
width: @icon-size-xxs;
height: @icon-size-xxs;
margin-left: @h-spacing-md;
.encoded-svg-background("<svg width='16' height='27' viewBox='0 0 16 27' version='1.1' xmlns='http://www.w3.org/2000/svg'><g transform='translate(-704.000000, -261.000000)' fill='#CCCCCC'><g transform='translate(0.000000, 204.000000)'><path d='M719.533036,70.040985 L719.571414,70.0026067 L706.568807,57 L704,59.5688074 L714.472178,70.040985 L704,80.5131625 L706.568807,83.08197 L719.571414,70.0793633 L719.533036,70.040985 Z'></path></g></g></svg>");
background-size: contain;
background-repeat: no-repeat;
background-position: 50% 50%;
visibility: hidden;
&-horizontal {
visibility: visible;
}
&-vertical {
visibility: visible;
.transform(rotate(90deg));
}
&-vertical-up {
visibility: visible;
.transform(rotate(270deg));
}
}
&-multiple {
padding: 25px @h-spacing-lg 25px 0;
.@{listPrefixCls}-content {
padding-top: 0;
padding-bottom: 0;
}
.@{listPrefixCls}-extra {
padding-top: 0;
padding-bottom: 0;
}
}
&-wrap {
.@{listPrefixCls}-content {
white-space: normal;
}
.@{listPrefixCls}-extra {
white-space: normal;
}
}
}
select {
position: relative;
display: block;
width: 100%;
height: 100%;
padding: 0;
border: 0;
font-size: @font-size-heading;
appearance: none;
background-color: transparent;
}
}