choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
447 lines (446 loc) • 13.6 kB
CSS
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
/* stylelint-disable no-duplicate-selectors */
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
.c7n-pro-switch {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1;
width: 100%;
height: 100%;
cursor: inherit;
opacity: 0;
}
.c7n-pro-switch-wrapper {
padding: 0.03rem;
}
.c7n-pro-switch-wrapper.c7n-pro-switch-loading {
cursor: not-allowed;
}
.c7n-pro-switch-wrapper.c7n-pro-switch-loading .c7n-progress-loading {
position: absolute;
top: 0;
bottom: 0;
left: 0.05rem;
z-index: 1;
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin: auto 0;
}
.c7n-pro-switch-wrapper.c7n-pro-switch-loading .c7n-progress-loading .c7n-progress-inner {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
width: 0.16rem;
height: 0.16rem;
}
.c7n-pro-switch-wrapper.c7n-pro-switch-loading .c7n-progress-loading .c7n-progress-inner svg {
width: 100%;
height: 100%;
}
.c7n-pro-switch-wrapper.c7n-pro-switch-loading .c7n-progress-loading .c7n-progress-inner svg circle {
stroke: #3f51b5;
}
.c7n-pro-switch-wrapper.c7n-pro-switch-loading.c7n-pro-switch-lg .c7n-progress-loading {
left: 0.02rem;
}
.c7n-pro-switch-wrapper.c7n-pro-switch-loading.c7n-pro-switch-lg .c7n-progress-loading .c7n-progress-inner {
width: 0.2rem;
height: 0.2rem;
}
.c7n-pro-switch-wrapper.c7n-pro-switch-loading.c7n-pro-switch-sm .c7n-progress-loading {
left: 0.02rem;
}
.c7n-pro-switch-wrapper.c7n-pro-switch-loading.c7n-pro-switch-sm .c7n-progress-loading .c7n-progress-inner {
width: 0.12rem;
height: 0.12rem;
}
.c7n-pro-switch-wrapper.c7n-pro-field {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
width: auto;
max-width: 100%;
}
.c7n-pro-switch-wrapper.c7n-pro-field .c7n-pro-switch-label {
max-width: inherit;
}
.c7n-pro-switch-wrapper.c7n-pro-field .c7n-pro-switch-label-content {
display: inline-block;
max-width: inherit;
overflow: hidden;
text-overflow: ellipsis;
}
.c7n-pro-switch-wrapper .icon-help {
z-index: 2;
margin-left: 0.04rem;
color: rgba(0, 0, 0, 0.45);
font-size: 0.16rem;
}
.c7n-pro-switch-wrapper {
position: relative;
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
line-height: 1.5;
white-space: nowrap;
vertical-align: middle;
outline: none;
cursor: pointer;
}
.c7n-pro-switch-invalid .c7n-pro-switch-inner {
border-color: #d50000;
}
.c7n-pro-switch:disabled {
cursor: not-allowed;
pointer-events: none;
}
.c7n-pro-switch-disabled {
cursor: not-allowed;
}
.c7n-pro-switch-float-label .c7n-pro-field-label {
padding: 0;
overflow: hidden;
color: inherit;
font-weight: 400;
line-height: 0.34rem;
white-space: nowrap;
text-overflow: ellipsis;
vertical-align: middle;
-webkit-transform-origin: inherit;
-ms-transform-origin: inherit;
transform-origin: inherit;
-webkit-transition: inherit;
transition: inherit;
}
.c7n-pro-switch-float-label .c7n-pro-field-label-wrapper {
position: absolute;
top: 0;
left: 0.1rem;
max-width: 98%;
height: 0;
margin-left: -0.05rem;
padding: 0 0.05rem;
border-top: 0.02rem solid #fff;
-webkit-transform-origin: 0.1rem -230%;
-ms-transform-origin: 0.1rem -230%;
transform-origin: 0.1rem -230%;
-webkit-transition: all 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
transition: all 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
}
.c7n-pro-switch-float-label .c7n-pro-field-label::after {
width: 0;
}
.c7n-pro-switch-float-label .c7n-pro-field-label.c7n-pro-field-required::after {
display: inline-block;
width: 0.08rem;
margin-left: 0.04rem;
color: #d50000;
font-family: SimSun, sans-serif;
line-height: 1;
vertical-align: middle;
content: '*';
}
.c7n-pro-switch-float-label.c7n-pro-switch-focused .c7n-pro-field-label {
color: #3f51b5;
}
.c7n-pro-switch-float-label.c7n-pro-switch-invalid .c7n-pro-field-label {
color: #d50000;
}
.c7n-pro-switch-float-label .c7n-pro-field-label-wrapper,
.c7n-pro-switch-float-label .c7n-pro-switch:focus + .c7n-pro-field-label-wrapper {
-webkit-transform: scaleX(0.8);
-ms-transform: scaleX(0.8);
transform: scaleX(0.8);
}
.c7n-pro-switch-float-label .c7n-pro-switch:-webkit-autofill + .c7n-pro-field-label-wrapper {
-webkit-transform: scaleX(0.8);
transform: scaleX(0.8);
}
.c7n-pro-switch-float-label .c7n-pro-field-label,
.c7n-pro-switch-float-label.c7n-pro-switch-focused .c7n-pro-field-label {
font-weight: 500;
font-size: 0.15rem;
-webkit-transform: scaleY(0.8);
-ms-transform: scaleY(0.8);
transform: scaleY(0.8);
}
.c7n-pro-switch-float-label .c7n-pro-switch:-webkit-autofill + .c7n-pro-field-label-wrapper .c7n-pro-field-label {
font-weight: 500;
font-size: 0.15rem;
-webkit-transform: scaleY(0.8);
transform: scaleY(0.8);
}
.c7n-pro-switch-float-label:not(.c7n-pro-switch-empty) .c7n-pro-field-label,
.c7n-pro-switch-float-label.c7n-pro-switch-focused .c7n-pro-field-label {
padding: 0rem;
line-height: 0.34rem;
background-color: unset;
}
.c7n-pro-switch-float-label:not(.c7n-pro-switch-multiple) .c7n-pro-switch {
height: 0.36rem;
border-radius: 0.05rem;
}
.c7n-pro-switch-float-label .c7n-pro-switch {
min-height: 0.36rem;
border-radius: 0.05rem;
}
.c7n-pro-switch-float-label.c7n-pro-switch-sm:not(.c7n-pro-switch-multiple) .c7n-pro-switch {
height: 0.3rem;
}
.c7n-pro-switch-float-label.c7n-pro-switch-sm .c7n-pro-field-label {
line-height: 0.28rem;
}
.c7n-pro-switch-float-label.c7n-pro-switch-lg:not(.c7n-pro-switch-multiple) .c7n-pro-switch {
height: 0.4rem;
}
.c7n-pro-switch-float-label.c7n-pro-switch-lg .c7n-pro-field-label {
line-height: 0.38rem;
}
.c7n-pro-switch-float-label.c7n-pro-switch-lg:not(.c7n-pro-switch-multiple) textarea.c7n-pro-switch,
.c7n-pro-switch-float-label.c7n-pro-switch-sm:not(.c7n-pro-switch-multiple) textarea.c7n-pro-switch,
.c7n-pro-switch-float-label:not(.c7n-pro-switch-multiple) textarea.c7n-pro-switch,
.c7n-pro-switch-float-label textarea.c7n-pro-switch {
height: auto;
}
.c7n-pro-switch-float-label.c7n-pro-switch-required-colors {
background-color: #fff;
}
.c7n-pro-switch-float-label.c7n-pro-switch-invalid {
background-color: #fff;
}
.c7n-pro-switch-float-label.c7n-pro-switch-disabled {
background-color: #fff;
}
.c7n-pro-switch-float-label.c7n-pro-switch-required .c7n-pro-field-label::after {
width: 0.08rem;
}
.c7n-pro-switch-empty:not(.c7n-pro-switch-focused) .c7n-pro-field-label {
font-weight: inherit;
font-size: inherit;
-webkit-transform: none;
-ms-transform: none;
transform: none;
pointer-events: none;
}
.c7n-pro-switch-empty:not(.c7n-pro-switch-focused) .c7n-pro-field-label-wrapper {
border-top-color: transparent;
-webkit-transform: none;
-ms-transform: none;
transform: none;
}
.c7n-pro-switch-float-label .c7n-pro-switch > ul {
margin: 0 0 0 0.03rem;
padding: 0.07rem 0;
}
.c7n-pro-switch-float-label .c7n-pro-switch > ul > li {
height: 0.2rem;
margin-top: 0.01rem;
margin-bottom: 0.01rem;
line-height: 0.2rem;
}
.c7n-pro-switch-float-label .c7n-pro-switch-multiple-block {
padding: 0 0.02rem 0 0.08rem;
border-radius: 0.12rem;
}
.c7n-pro-switch-float-label .c7n-pro-switch-multiple-block .icon {
color: rgba(255, 255, 255, 0.72);
font-size: 0.16rem;
line-height: 0.2rem;
vertical-align: top;
}
.c7n-pro-switch-float-label .c7n-pro-switch-multiple-block .icon:hover {
color: inherit;
}
.c7n-pro-switch-prefix-button.c7n-pro-switch-float-label .c7n-pro-field-label-wrapper {
left: 0.24rem;
}
.c7n-pro-switch-float-label {
padding-top: 0.07rem;
}
.c7n-pro-switch-label {
position: relative;
display: inline-block;
min-width: 0.36rem;
height: 0.16rem;
padding-right: 0.05rem;
padding-left: calc(0.2rem * 1.2);
color: #ffffff;
font-size: 0.12rem;
line-height: 0.16rem;
text-align: center;
vertical-align: middle;
background-color: rgba(0, 0, 0, 0.38);
border: none;
border-radius: calc(0.16rem / 2);
}
.c7n-pro-switch-label::after {
position: absolute;
top: 0;
bottom: 0;
left: 0rem;
width: 0.2rem;
height: 0.2rem;
margin-top: auto;
margin-bottom: auto;
margin-left: 0rem;
background-color: #fff;
border-radius: 50%;
-webkit-box-shadow: 0 0.02rem 0.01rem -0.01rem rgba(0, 0, 0, 0.2), 0 0.01rem 0.01rem 0 rgba(0, 0, 0, 0.14), 0 0.01rem 0.03rem 0 rgba(0, 0, 0, 0.12);
box-shadow: 0 0.02rem 0.01rem -0.01rem rgba(0, 0, 0, 0.2), 0 0.01rem 0.01rem 0 rgba(0, 0, 0, 0.14), 0 0.01rem 0.03rem 0 rgba(0, 0, 0, 0.12);
cursor: inherit;
-webkit-transition: all 0.36s cubic-bezier(0.78, 0.14, 0.15, 0.86);
transition: all 0.36s cubic-bezier(0.78, 0.14, 0.15, 0.86);
content: ' ';
}
.c7n-pro-switch-label .icon {
font-size: 0.16rem;
vertical-align: baseline;
}
.c7n-pro-switch:active + .c7n-pro-switch-label::after {
width: 0.24rem;
}
.c7n-pro-switch-focused .c7n-pro-switch-label {
-webkit-box-shadow: 0 0 0 0.02rem rgba(182, 191, 219, 0.2);
box-shadow: 0 0 0 0.02rem rgba(182, 191, 219, 0.2);
}
.c7n-pro-switch-focused:hover .c7n-pro-switch-label {
-webkit-box-shadow: none;
box-shadow: none;
}
.c7n-pro-switch-float-label {
padding-right: 0.08rem;
padding-left: 0.08rem;
vertical-align: middle;
}
.c7n-pro-switch:checked + .c7n-progress-loading {
right: 0.05rem;
left: auto;
}
.c7n-pro-switch:checked + .c7n-progress-loading .c7n-progress-inner svg circle {
stroke: #FFF;
}
.c7n-pro-switch-lg .c7n-pro-switch:checked + .c7n-progress-loading {
right: 0.02rem;
left: auto;
}
.c7n-pro-switch-sm .c7n-pro-switch:checked + .c7n-progress-loading {
right: 0.02rem;
left: auto;
}
.c7n-pro-switch:checked + .c7n-pro-switch-label,
.c7n-pro-switch:checked + .c7n-progress-loading + .c7n-pro-switch-label {
padding-right: calc(0.2rem * 1.2);
padding-left: 0.05rem;
color: #ffffff;
background-color: #b6bfdb;
border-color: transparent;
}
.c7n-pro-switch:checked + .c7n-pro-switch-label::after,
.c7n-pro-switch:checked + .c7n-progress-loading + .c7n-pro-switch-label::after {
left: 100%;
margin-left: calc(-1 * 0rem);
background-color: #3f51b5;
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
}
.c7n-pro-switch:disabled {
cursor: not-allowed;
}
.c7n-pro-switch:disabled + .c7n-pro-switch-label,
.c7n-pro-switch:disabled + .c7n-progress-loading + .c7n-pro-switch-label {
color: #ffffff;
background-color: rgba(0, 0, 0, 0.38);
opacity: 0.4;
}
.c7n-pro-switch:disabled + .c7n-pro-switch-label::after,
.c7n-pro-switch:disabled + .c7n-progress-loading + .c7n-pro-switch-label::after {
background-color: #fff;
}
.c7n-pro-switch:checked:disabled + .c7n-pro-switch-label,
.c7n-pro-switch:checked:disabled + .c7n-progress-loading + .c7n-pro-switch-label {
color: #ffffff;
background-color: #b6bfdb;
}
.c7n-pro-switch:checked:disabled + .c7n-pro-switch-label::after,
.c7n-pro-switch:checked:disabled + .c7n-progress-loading + .c7n-pro-switch-label::after {
background-color: #3f51b5;
}
.c7n-pro-switch-sm {
padding: 0rem;
}
.c7n-pro-switch-sm .c7n-pro-switch + .c7n-pro-switch-label::after,
.c7n-pro-switch-sm .c7n-pro-switch + .c7n-progress-loading + .c7n-pro-switch-label::after {
left: 0rem;
}
.c7n-pro-switch-sm .c7n-pro-switch:checked + .c7n-pro-switch-label::after,
.c7n-pro-switch-sm .c7n-pro-switch:checked + .c7n-progress-loading + .c7n-pro-switch-label::after {
left: 100%;
}
.c7n-pro-switch-sm .c7n-pro-switch-label {
min-width: 0.3rem;
height: 0.12rem;
line-height: 0.12rem;
border-radius: calc(0.12rem / 2);
}
.c7n-pro-switch-sm .c7n-pro-switch-label .icon {
font-size: 0.12rem;
}
.c7n-pro-switch-sm .c7n-pro-switch-label::after {
width: 0.16rem;
height: 0.16rem;
}
.c7n-pro-switch-sm .c7n-pro-switch:active + .c7n-pro-switch-label::after {
width: 0.2rem;
}
.c7n-pro-switch-lg {
padding: 0.03rem 0;
}
.c7n-pro-switch-lg .c7n-pro-switch + .c7n-pro-switch-label::after,
.c7n-pro-switch-lg .c7n-pro-switch + .c7n-progress-loading + .c7n-pro-switch-label::after {
left: 0rem;
}
.c7n-pro-switch-lg .c7n-pro-switch:checked + .c7n-pro-switch-label::after,
.c7n-pro-switch-lg .c7n-pro-switch:checked + .c7n-progress-loading + .c7n-pro-switch-label::after {
left: 100%;
}
.c7n-pro-switch-lg .c7n-pro-switch-label {
min-width: 0.4rem;
height: 0.2rem;
line-height: 0.2rem;
border-radius: calc(0.2rem / 2);
}
.c7n-pro-switch-lg .c7n-pro-switch-label .icon {
font-size: 0.2rem;
}
.c7n-pro-switch-lg .c7n-pro-switch-label::after {
width: 0.24rem;
height: 0.24rem;
}
.c7n-pro-switch-lg .c7n-pro-switch:active + .c7n-pro-switch-label::after {
width: 0.28rem;
}
.c7n-pro-switch-float-label .c7n-pro-field-label-wrapper {
left: 0;
-webkit-transform-origin: 0.1rem -330%;
-ms-transform-origin: 0.1rem -330%;
transform-origin: 0.1rem -330%;
}