@alifd/next
Version:
A configurable component library for web built on React.
456 lines (445 loc) • 14.8 kB
CSS
.next-sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
top: 0;
margin: -1px;
}
.next-radio-button-large[dir=rtl] > label:first-child {
margin-left: -1px;
border-top-right-radius: 3px;
border-top-right-radius: var(--radio-button-corner-large, 3px);
border-bottom-right-radius: 3px;
border-bottom-right-radius: var(--radio-button-corner-large, 3px);
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.next-radio-button-large[dir=rtl] > label:last-child {
margin-left: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-top-left-radius: 3px;
border-top-left-radius: var(--radio-button-corner-large, 3px);
border-bottom-left-radius: 3px;
border-bottom-left-radius: var(--radio-button-corner-large, 3px);
}
.next-radio-button-large[dir=rtl] .next-radio-label {
height: 38px;
height: calc(var(--radio-button-height-large, 40px) - 2px);
line-height: 38px;
line-height: calc(var(--radio-button-height-large, 40px) - 2px);
font-size: 16px;
font-size: var(--radio-button-font-size-large, 16px);
}
.next-radio-button-medium[dir=rtl] > label:first-child {
margin-left: -1px;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: 3px;
border-top-right-radius: var(--radio-button-corner-medium, 3px);
border-bottom-right-radius: 3px;
border-bottom-right-radius: var(--radio-button-corner-medium, 3px);
}
.next-radio-button-medium[dir=rtl] > label:last-child {
margin-left: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-top-left-radius: 3px;
border-top-left-radius: var(--radio-button-corner-medium, 3px);
border-bottom-left-radius: 3px;
border-bottom-left-radius: var(--radio-button-corner-medium, 3px);
}
.next-radio-button-small[dir=rtl] > label:first-child {
margin-left: -1px;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: 3px;
border-top-right-radius: var(--radio-button-corner-small, 3px);
border-bottom-right-radius: 3px;
border-bottom-right-radius: var(--radio-button-corner-small, 3px);
}
.next-radio-button-small[dir=rtl] > label:last-child {
margin-left: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-top-left-radius: 3px;
border-top-left-radius: var(--radio-button-corner-small, 3px);
border-bottom-left-radius: 3px;
border-bottom-left-radius: var(--radio-button-corner-small, 3px);
}
.next-radio-wrapper[dir=rtl] .next-radio-label {
margin-left: 0;
margin-right: 4px;
}
.next-radio-group[dir=rtl] .next-radio-label {
margin-right: 4px;
margin-left: 16px;
}
.next-radio-button[dir=rtl] > label .next-radio-label {
margin: 0;
}
.next-radio-wrapper {
outline: 0;
display: inline-block;
}
.next-radio-wrapper .next-radio {
box-sizing: border-box;
display: inline-block;
vertical-align: middle;
position: relative;
line-height: 1;
}
.next-radio-wrapper .next-radio *,
.next-radio-wrapper .next-radio *:before,
.next-radio-wrapper .next-radio *:after {
box-sizing: border-box;
}
.next-radio-wrapper .next-radio input[type=radio] {
opacity: 0;
position: absolute;
vertical-align: middle;
top: 0;
left: 0;
width: 16px;
width: var(--radio-width, 16px);
height: 16px;
height: var(--radio-width, 16px);
margin: 0;
cursor: pointer;
}
.next-radio-wrapper .next-radio-inner {
/* 动画待定 */
/* &.mouseDown { */
/* transform: scale3d(.7, .7, .7); */
/* transition: transform .2s linear; */
/* } */
/* &.mouseUp { */
/* transform: scale3d(1, 1, 1); */
/* transition: transform .2s linear; */
/* } */
display: block;
width: 16px;
width: var(--radio-width, 16px);
height: 16px;
height: var(--radio-width, 16px);
background: #FFFFFF;
background: var(--radio-bg-color, #FFFFFF);
border-radius: 50%;
border-radius: var(--radio-radius-size, 50%);
border: 1px solid #C4C6CF;
border: var(--radio-circle-border-width, 1px) solid var(--radio-border-color, #C4C6CF);
transition: all 100ms linear;
transition: all var(--motion-duration-immediately, 100ms) var(--motion-linear, linear);
box-shadow: none;
box-shadow: var(--radio-shadow, none);
}
.next-radio-wrapper .next-radio-inner:after {
transform: scale(0);
position: absolute;
border-radius: 50%;
border-radius: var(--radio-radius-size, 50%);
top: 50%;
margin-top: -2px;
margin-top: calc(0px - var(--radio-circle-size, 4px)/2);
left: 50%;
margin-left: -2px;
margin-left: calc(0px - var(--radio-circle-size, 4px)/2);
background: #FFFFFF;
content: "";
transition: all 100ms linear;
transition: all var(--motion-duration-immediately, 100ms) var(--motion-linear, linear);
}
.next-radio-wrapper.checked .next-radio-inner {
border-color: #5584FF;
border-color: var(--radio-checked-border-color, #5584FF);
background: #5584FF;
background: var(--radio-checked-bg-color, #5584FF);
}
.next-radio-wrapper.checked .next-radio-inner:after {
width: 4px;
width: var(--radio-circle-size, 4px);
height: 4px;
height: var(--radio-circle-size, 4px);
font-weight: bold;
background: #FFFFFF;
background: var(--radio-checked-circle-color, #FFFFFF);
transform: scale(1);
}
.next-radio-wrapper.checked:hover .next-radio-inner, .next-radio-wrapper.checked.hovered .next-radio-inner {
border-color: transparent;
border-color: var(--radio-checked-hovered-border-color, transparent);
}
.next-radio-wrapper.disabled input[type=radio] {
cursor: not-allowed;
}
.next-radio-wrapper.disabled .next-radio-inner {
border-color: #E6E7EB;
border-color: var(--radio-disabled-border-color, #E6E7EB);
background: #F7F8FA;
background: var(--radio-disabled-bg-color, #F7F8FA);
}
.next-radio-wrapper.disabled .next-radio-inner:after {
background: #CCCCCC;
background: var(--radio-disabled-circle-color, #CCCCCC);
}
.next-radio-wrapper.disabled .next-radio-inner:hover, .next-radio-wrapper.disabled .next-radio-inner.hovered {
border-color: #E6E7EB;
border-color: var(--radio-disabled-border-color, #E6E7EB);
}
.next-radio-wrapper.disabled.checked .next-radio-inner {
border-color: #E6E7EB;
border-color: var(--radio-checked-disabled-border-color, #E6E7EB);
background: #F7F8FA;
background: var(--radio-checked-disabled-bg-color, #F7F8FA);
}
.next-radio-wrapper.disabled.checked .next-radio-inner:after {
background: #CCCCCC;
background: var(--radio-checked-disabled-circle-color, #CCCCCC);
}
.next-radio-wrapper.disabled .next-radio-label {
color: #CCCCCC;
color: var(--radio-normal-font-color-disabled, #CCCCCC);
}
.next-radio-wrapper:not(.disabled):hover .next-radio-inner, .next-radio-wrapper:not(.disabled).hovered .next-radio-inner {
border-color: #5584FF;
border-color: var(--radio-hovered-border-color, #5584FF);
background-color: #DEE8FF;
background-color: var(--radio-hovered-bg-color, #DEE8FF);
}
.next-radio-wrapper:not(.disabled):hover .next-radio-label, .next-radio-wrapper:not(.disabled).hovered .next-radio-label {
cursor: pointer;
}
.next-radio-wrapper.checked:not(.disabled):hover .next-radio-inner, .next-radio-wrapper.checked:not(.disabled).hovered .next-radio-inner {
border-color: transparent;
border-color: var(--radio-checked-hovered-border-color, transparent);
background: #3E71F7;
background: var(--radio-checked-hovered-bg-color, #3E71F7);
}
.next-radio-wrapper.checked:not(.disabled):hover .next-radio-inner:after, .next-radio-wrapper.checked:not(.disabled).hovered .next-radio-inner:after {
background: #FFFFFF;
background: var(--radio-checked-hovered-circle-color, #FFFFFF);
}
.next-radio-button .next-radio {
width: 0;
height: 0;
}
.next-radio-button input[type=radio] {
width: 0;
height: 0;
}
.next-radio-button > label {
display: inline-block;
box-sizing: border-box;
position: relative;
z-index: 1;
margin: 0 0 0 -1px;
border: 1px solid #C4C6CF;
border: 1px solid var(--radio-button-border-color, #C4C6CF);
background-color: #FFFFFF;
background-color: var(--radio-button-bg-color, #FFFFFF);
transition: all 100ms linear;
transition: all var(--motion-duration-immediately, 100ms) var(--motion-linear, linear);
vertical-align: middle;
}
.next-radio-button > label .next-radio-label {
display: block;
color: #333333;
color: var(--radio-button-font-color, #333333);
margin: 0;
transition: all 100ms linear;
transition: all var(--motion-duration-immediately, 100ms) var(--motion-linear, linear);
}
.next-radio-button > label:hover, .next-radio-button > label.hovered {
z-index: 10;
border-color: #A0A2AD;
border-color: var(--radio-button-border-color-hovered, #A0A2AD);
background-color: #F2F3F7;
background-color: var(--radio-button-bg-color-hovered, #F2F3F7);
}
.next-radio-button > label:hover .next-radio-label, .next-radio-button > label.hovered .next-radio-label {
color: #333333;
color: var(--radio-button-font-color-hovered, #333333);
}
.next-radio-button > label.checked {
z-index: 11;
border-color: #5584FF;
border-color: var(--radio-button-border-color-checked, #5584FF);
background-color: #FFFFFF;
background-color: var(--radio-button-bg-color-checked, #FFFFFF);
}
.next-radio-button > label.checked .next-radio-label {
color: #5584FF;
color: var(--radio-button-font-color-checked, #5584FF);
}
.next-radio-button > label.disabled {
z-index: 0;
cursor: not-allowed;
border-color: #E6E7EB;
border-color: var(--radio-button-border-color-disabled, #E6E7EB);
background-color: #F7F8FA;
background-color: var(--radio-button-bg-color-disabled, #F7F8FA);
}
.next-radio-button > label.disabled .next-radio-label {
color: #CCCCCC;
color: var(--radio-button-font-color-disabled, #CCCCCC);
}
.next-radio-button > label.checked.disabled {
z-index: 0;
border-color: #E6E7EB;
border-color: var(--radio-button-border-color-checked-disabled, #E6E7EB);
background-color: #F2F3F7;
background-color: var(--radio-button-bg-color-checked-disabled, #F2F3F7);
}
.next-radio-button > label.checked.disabled .next-radio-label {
color: #CCCCCC;
color: var(--radio-button-font-color-checked-disabled, #CCCCCC);
}
.next-radio-button-large > label {
padding: 0 8px;
padding: 0 var(--radio-button-padding-large, 8px);
height: 40px;
height: var(--radio-button-height-large, 40px);
line-height: 40px;
line-height: var(--radio-button-height-large, 40px);
}
.next-radio-button-large > label:first-child {
margin-left: 0;
border-top-left-radius: 3px;
border-top-left-radius: var(--radio-button-corner-large, 3px);
border-bottom-left-radius: 3px;
border-bottom-left-radius: var(--radio-button-corner-large, 3px);
}
.next-radio-button-large > label:last-child {
border-top-right-radius: 3px;
border-top-right-radius: var(--radio-button-corner-large, 3px);
border-bottom-right-radius: 3px;
border-bottom-right-radius: var(--radio-button-corner-large, 3px);
}
.next-radio-button-large .next-radio-label {
height: 38px;
height: calc(var(--radio-button-height-large, 40px) - 2px);
line-height: 38px;
line-height: calc(var(--radio-button-height-large, 40px) - 2px);
font-size: 16px;
font-size: var(--radio-button-font-size-large, 16px);
}
.next-radio-button-medium > label {
padding: 0 8px;
padding: 0 var(--radio-button-padding-medium, 8px);
height: 28px;
height: var(--radio-button-height-medium, 28px);
line-height: 28px;
line-height: var(--radio-button-height-medium, 28px);
}
.next-radio-button-medium > label:first-child {
margin-left: 0;
border-top-left-radius: 3px;
border-top-left-radius: var(--radio-button-corner-medium, 3px);
border-bottom-left-radius: 3px;
border-bottom-left-radius: var(--radio-button-corner-medium, 3px);
}
.next-radio-button-medium > label:last-child {
border-top-right-radius: 3px;
border-top-right-radius: var(--radio-button-corner-medium, 3px);
border-bottom-right-radius: 3px;
border-bottom-right-radius: var(--radio-button-corner-medium, 3px);
}
.next-radio-button-medium .next-radio-label {
height: 26px;
height: calc(var(--radio-button-height-medium, 28px) - 2px);
line-height: 26px;
line-height: calc(var(--radio-button-height-medium, 28px) - 2px);
font-size: 12px;
font-size: var(--radio-button-font-size-medium, 12px);
}
.next-radio-button-small > label {
padding: 0 8px;
padding: 0 var(--radio-button-padding-small, 8px);
height: 20px;
height: var(--radio-button-height-small, 20px);
line-height: 20px;
line-height: var(--radio-button-height-small, 20px);
}
.next-radio-button-small > label:first-child {
margin-left: 0;
border-top-left-radius: 3px;
border-top-left-radius: var(--radio-button-corner-small, 3px);
border-bottom-left-radius: 3px;
border-bottom-left-radius: var(--radio-button-corner-small, 3px);
}
.next-radio-button-small > label:last-child {
border-top-right-radius: 3px;
border-top-right-radius: var(--radio-button-corner-small, 3px);
border-bottom-right-radius: 3px;
border-bottom-right-radius: var(--radio-button-corner-small, 3px);
}
.next-radio-button-small .next-radio-label {
height: 18px;
height: calc(var(--radio-button-height-small, 20px) - 2px);
line-height: 18px;
line-height: calc(var(--radio-button-height-small, 20px) - 2px);
font-size: 12px;
font-size: var(--radio-button-font-size-small, 12px);
}
.next-radio-single-input input[type=radio] {
opacity: 0;
position: absolute;
top: 0;
left: 0;
margin: 0;
}
.next-radio-group {
display: inline-block;
}
.next-radio-group .next-radio-wrapper {
/* 表现为radio整体之间多一份间隔,checkbox表现一致 */
margin-right: 12px;
}
.next-radio-group .next-radio-wrapper:last-child {
margin-right: 0;
}
.next-radio-group .next-radio-label {
color: #333333;
color: var(--radio-normal-font-color, #333333);
}
.next-radio-group.disabled .next-radio-label {
color: #CCCCCC;
color: var(--radio-normal-font-color-disabled, #CCCCCC);
}
.next-radio-group.next-radio-button .next-radio-wrapper {
margin-right: 0;
}
.next-radio-group-ver .next-radio-wrapper {
display: block;
margin-bottom: 8px;
}
.next-radio-label {
margin: 0;
margin-left: 4px;
margin-left: var(--radio-font-margin-left, 4px);
/* 使用已有变量$radio-font-margin-left,配左即两边都有间隔 */
margin-right: 4px;
margin-right: var(--radio-font-margin-left, 4px);
font-size: 12px;
font-size: var(--radio-font-size, 12px);
vertical-align: middle;
line-height: 1;
color: #333333;
color: var(--radio-normal-font-color, #333333);
}
@-moz-document url-prefix() {
.next-radio {
margin-top: -1px;
}
@supports (animation: calc(0s)) {
/* firefox 57+ */
.next-radio {
margin-top: -3px;
}
}
}