zmp-ui
Version:
Zalo Mini App framework
235 lines (199 loc) • 5.97 kB
text/less
@import "./variables.less";
@import "./mixins.less";
.@{calendar-prefix-cls} {
.item-enter {
opacity: 0;
}
.item-enter-active {
opacity: 1;
transition: opacity 500ms ease-in;
}
.item-exit {
opacity: 1;
}
.item-exit-active {
opacity: 0;
transition: opacity 500ms ease-in;
}
&-header {
display: flex;
justify-content: space-between;
align-items: center;
&-title {
cursor: pointer;
color: @light-calendar-title-color;
&:hover {
color: @light-calendar-title-hover-color;
}
}
}
&-panel {
text-align: center;
background: @light-calendar-bg-color;
border-radius: 8px;
.@{calendar-prefix-cls}-full & {
display: block;
width: 100%;
text-align: right;
}
&-month,
&-year,
&-decade {
tr {
display: flex;
flex-wrap: wrap;
justify-content: center;
max-width: 480px;
margin: auto;
}
td {
width: 120px;
}
}
&-body {
th {
height: auto;
.@{calendar-prefix-cls}-full & {
padding-inline-end: 12px;
padding-bottom: 4px;
line-height: 18px;
}
}
}
&-content {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
&-cell {
padding: 6px 0;
color: @light-calendar-cell-text-color;
cursor: pointer;
.@{calendar-prefix-cls}-full & {
padding: 0;
}
&-in-view {
color: @light-calendar-cell-in-view-text-color;
&.@{calendar-prefix-cls}-panel-cell-selected:not(.@{calendar-prefix-cls}-panel-cell-disabled) {
.@{calendar-prefix-cls}-cell-inner {
color: @light-calendar-cell-selected-text-color;
background: @light-calendar-cell-selected-background;
}
.@{calendar-prefix-cls}-cell-inner-content {
color: @light-calendar-cell-selected-background;
}
.@{calendar-prefix-cls}-full & {
.@{calendar-prefix-cls}-cell-inner {
background: @light-calendar-cell-full-selected-background;
&-label {
color: @light-calendar-cell-full-selected-text-color;
}
}
}
}
}
&-disabled {
color: @light-calendar-cell-disabled-text-color;
pointer-events: none;
.@{calendar-prefix-cls}-cell-inner {
background: transparent;
}
}
}
}
&-cell-inner {
position: relative;
z-index: 2;
display: inline-block;
min-width: 24px;
height: 24px;
line-height: 24px;
border-radius: 4px;
transition: background 0.2s;
&::before {
display: block;
width: 100%;
box-sizing: border-box;
.@{calendar-prefix-cls}-full & {
display: none;
}
}
.@{calendar-prefix-cls}-panel-cell-in-view.@{calendar-prefix-cls}-panel-cell-today:not(.@{calendar-prefix-cls}-panel-cell-disabled)
& {
&::before {
position: absolute;
top: 0;
left: 0;
inset-inline-end: 0;
bottom: 0;
inset-inline-start: 0;
z-index: 1;
border: 1px solid @light-calendar-selected-background;
border-radius: 4px;
content: "";
}
.@{calendar-prefix-cls}-full & {
border-color: @light-calendar-selected-background;
}
}
.@{calendar-prefix-cls}-full & {
display: block;
width: auto;
height: auto;
margin: 0 4px;
padding: 4px 8px 0;
border: 0;
border-top: 2px solid rgba(5, 5, 5, 0.06);
border-radius: 0;
transition: background 0.3s;
}
&-content {
.@{calendar-prefix-cls}-full & {
position: static;
width: auto;
height: 86px;
overflow-y: auto;
color: @light-calendar-cell-in-view-text-color;
line-height: 1.5714285714285714;
text-align: start;
scrollbar-width: thin;
}
}
&-label {
padding: 0 8px;
}
}
}
.if-dark-theme( {
.@{calendar-prefix-cls} {
&-header {
&-title {
color: @dark-calendar-title-color;
&:hover {
color: @light-calendar-title-hover-color;
}
}
}
&-panel {
background: @dark-calendar-bg-color;
&-cell {
color: @dark-calendar-cell-text-color;
&-in-view {
color: @dark-calendar-cell-in-view-text-color;
}
&-disabled {
color: @dark-calendar-cell-disabled-text-color;
}
}
}
}
.@{calendar-prefix-cls}-full {
.@{calendar-prefix-cls}-cell-inner {
border-top-color: @ng80;
&-content {
color: @dark-calendar-cell-in-view-text-color;
}
}
}
}
);