@aplus-frontend/ui
Version:
395 lines (386 loc) • 9.05 kB
text/less
@import '../mixins/mixins.less';
.b(pro-card, {
position: relative;
display: flex;
flex-direction: column;
box-sizing: border-box;
padding: 0;
width: 100%;
transition: all 0.3s;
background: var(--ap-pro-card-color-bg-container);
border-radius: var(--ap-pro-card-border-radius);
font-size: 12px;
line-height: 18px;
&-border {
border: var(--ap-pro-card-border-line-width) var(--ap-pro-card-border-line-type) var(--ap-pro-card-border-color-split);
}
&-box-shadow {
border-color: transparent;
box-shadow: var(--ap-pro-card-box-shadow);
}
&-hoverable {
cursor: pointer;
transition: box-shadow 0.3s, border-color 0.3s;
&:hover {
border-color: transparent;
box-shadow: var(--ap-pro-card-box-shadow);
}
}
&-header {
display: flex;
align-items: center;
padding: var(--ap-pro-card-header-padding);
&-title {
display: flex;
font-size: var(--ap-pro-card-header-title-font-size);
color: var(--ap-pro-card-header-title-font-color);
font-weight: 500;
&-tooltip {
margin-left: 5px;
font-size: 12px;
color: var(--ap-pro-card-tooltip-color);
}
}
&-extra {
margin-inline-start: auto;
}
&-border {
padding-block-end: var(--ap-pro-card-header-padding-bottom);
border-block-end: var(--ap-pro-card-border-line-width) var(--ap-pro-card-border-line-type) var(--ap-pro-card-border-color-split);
}
&-collapsible {
cursor: pointer;
}
}
&-collapsible-icon {
margin-inline-end: 4px;
color: var(--ap-pro-card-header-title-font-color);
font-size: 14px;
transition: transform 0.3s;
&:hover {
color: var(--ap-hover-color-base);
}
&.aplus-frontend-icon {
display: flex;
align-items: center;
justify-content: center;
}
}
&-type-inner > &-header {
background: var(--ap-pro-card-area-color);
}
&-body {
display: block;
box-sizing: border-box;
height: 100%;
padding: var(--ap-pro-card-body-padding);
&-center {
display: flex;
align-items: center;
justify-content: center;
}
&-direction-column {
flex-direction: column
}
&-wrap {
flex-wrap: wrap
}
}
&-contain-card > &-body {
display: flex;
}
&-split > &-body {
padding: 0;
}
&-ghost {
background: transparent;
}
&-ghost > &-body {
background: transparent;
padding: 0;
}
&-col {
width: 100%;
&-split-vertical {
position: relative;
&::after {
position: absolute;
height: var(--ap-pro-card-split-line-height);
top: 50%;
transform: translateY(-50%);
right: 0;
border-right: var(--ap-pro-card-border-line-width) var(--ap-pro-card-border-line-type) var(--ap-pro-card-border-color-split);
content: '';
}
}
&-split-horizontal {
position: relative;
&::after {
position: absolute;
width: var(--ap-pro-card-split-line-height);
left: 50%;
transform: translateX(-50%);
bottom: 0;
border-bottom: var(--ap-pro-card-border-line-width) var(--ap-pro-card-border-line-type) var(--ap-pro-card-border-color-split);
content: '';
}
}
&-span-0 {
display: none;
}
.loop-span(@i) when (@i <= 24) {
&-span-@{i} {
flex-shrink: 0;
width: calc((@i / 24) * 100%);
}
.loop-span(@i + 1);
}
.loop-span(1);
}
&-actions {
border-block-start:var(--ap-pro-card-border-line-width) var(--ap-pro-card-border-line-type) var(--ap-pro-card-border-color-split);
background: var(--ap-pro-card-color-bg-container);
padding: var(--ap-pro-card-actions-padding);
}
&-collapsed > &-header {
padding-block-end: var(--ap-pro-card-header-padding-bottom);
border-block-end: 0;
}
&-collapsed > &-body {
display: none;
}
});
.b(pro-card-title, {
&-default {
position: relative;
font-weight: bold;
font-size: 12px;
display: flex;
align-items: center;
&-aplus {
padding-left: 10px;
&::before {
position: absolute;
content: '';
left: 0;
top: 50%;
transform: translateY(-50%);
width: 3px;
height: 14px;
background: #0070ff;
border-radius: 0px 4px 4px 0px;
}
}
&-admin {
padding-left: 14px;
&::before {
position: absolute;
content: '';
left: 0;
top: 50%;
transform: translateY(-50%);
width: 8px;
height: 8px;
border-radius: 50%;
border-width: 2px;
border-style: solid;
border-color: #34b77c;
background: #fff;
}
}
}
});
.b(pro-card-divider, {
flex: none;
background: var(--ap-pro-card-border-color-split);
&-vertical {
position: relative;
margin-inline: 8px;
&::after {
position: absolute;
height: var(--ap-pro-card-divider-line-height);
top: 50%;
transform: translateY(-50%);
right: 0;
border-right: var(--ap-pro-card-border-line-width) var(--ap-pro-card-border-line-type) var(--ap-pro-card-border-color-split);
content: '';
}
}
&-horizontal {
position: relative;
margin-block: 8px;
&::after {
position: absolute;
width: var(--ap-pro-card-divider-line-height);
left: 50%;
transform: translateX(-50%);
bottom: 0;
border-bottom: var(--ap-pro-card-border-line-width) var(--ap-pro-card-border-line-type) var(--ap-pro-card-border-color-split);
content: '';
}
}
});
.b(pro-card-operation, {
display: flex;
flex-direction: column;
justify-content: center;
margin-inline: 0;
font-weight: 500;
font-size: 20px;
line-height: 26px;
});
.b(pro-card-statistic, {
display: flex;
& + & {
margin-block-start: 4px;
}
&-tip {
margin-inline-start: 4px;
color: var(--ap-text-color-3);
}
&-wrapper {
display: flex;
width: 100%;
}
&-status {
width: 14px;
&.ant-badge.ant-badge-status {
line-height: 18px;
}
}
&-icon {
margin-inline-end: 16px;
}
&-trend-icon {
width: 0;
height: 0;
border-inline-end: 3px solid transparent;
border-block-end: 6px solid #000;
border-inline-start: 3px solid transparent;
&-up {
transform: rotate(0deg) translateY(-1px);
}
&-down {
transform: rotate(180deg) translateY(1px);
}
}
&-content {
width: 100%;
.ant-statistic-content {
font-size: 20px;
line-height: 24px;
font-weight: bold;
}
}
&-description {
width: 100%;
margin-top: 4px;
}
.ant-statistic-title {
color: var(--ap-text-color-1);
font-size: 12px;
line-height: 18px;
margin-bottom: 8px;
}
&-size-small {
.ant-statistic-title {
margin-bottom: 4px;
}
.ant-statistic-content {
font-size: 16px;
line-height: 22px;
}
}
&-trend-up {
.ant-statistic-content {
color: var(--ap-color-error);
}
}
&-trend-up &-trend-icon {
border-block-end-color: var(--ap-color-error);
}
&-trend-down {
.ant-statistic-content {
color: var(--ap-color-success);
}
}
&-trend-down &-trend-icon {
border-block-end-color: var(--ap-color-success);
}
& &-layout-horizontal {
display: flex;
justify-content: space-between;
.ant-statistic-title {
margin-block-end: 0;
color: var(--ap-text-color-3);
}
.ant-statistic-content {
color: var(--ap-text-color-2);
font-size: 12px;
line-height: 18px;
font-weight: 500;
}
.ant-statistic-title {
font-size: 12px;
line-height: 18px;
font-weight: 500;
}
}
& &-layout-inline {
display: inline-flex;
.ant-statistic-title {
margin-inline-end: 6px;
margin-block-end: 0;
color: var(--ap-text-color-3);
}
.ant-statistic-content {
color: var(--ap-text-color-2);
font-size: 12px;
line-height: 18px;
font-weight: 500;
}
.ant-statistic-title {
font-size: 12px;
line-height: 18px;
font-weight: 500;
}
}
& &-layout-vertical-center {
display: flex;
flex-direction: column;;
align-items: center;
}
});
.b(statistic-card, {
&-chart {
display: flex;
flex-direction: column;
margin-block-start: 8px;
margin-block-end: 8px;
&-left {
margin-block-start: 0;
margin-inline-end: 16px;
}
&-right {
margin-block-start: 0;
margin-inline-start: 16px;
}
}
&-content {
display: flex;
flex-direction: column;
&-horizontal {
flex-direction: row;
}
}
&-chart {
width: 100%;
align-items: center;
align-self: flex-start;
}
&-footer {
margin-block-start: 8px;
padding-block-start: 16px;
border-block-start: var(--ap-pro-card-border-line-width) var(--ap-pro-card-border-line-type) var(--ap-pro-card-border-color-split);
}
});