UNPKG

@fe6/water-pro

Version:

An enterprise-class UI design language and Vue-based implementation

156 lines (139 loc) 3.05 kB
@checkboxWarpPrefixCls: rc-checkbox; @checkboxInnerPrefixCls: ~'@{checkboxWarpPrefixCls}-inner'; /* 一般状态 */ .@{checkboxWarpPrefixCls} { position: relative; display: inline-block; line-height: 1; white-space: nowrap; vertical-align: middle; outline: none; cursor: pointer; &:hover .@{checkboxInnerPrefixCls}, &-input:focus + .@{checkboxInnerPrefixCls} { border-color: #3dbcf6; } &-inner { &::after { position: absolute; top: 1px; left: 4px; display: table; width: 5px; height: 8px; border: 2px solid #fff; border-top: 0; border-left: 0; -webkit-transform: rotate(45deg); transform: rotate(45deg); animation-name: amCheckboxOut; animation-duration: 0.3s; animation-timing-function: cubic-bezier(0.68, -0.55, 0.27, 1.55); content: ' '; } position: relative; top: 0; left: 0; display: inline-block; width: 14px; height: 14px; background-color: #fff; border-color: #d9d9d9; border-style: solid; border-width: 1px; border-radius: 3px; transition: border-color 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), background-color 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55); } &-input { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 9999; cursor: pointer; opacity: 0; } } /* 选中状态 */ .@{checkboxWarpPrefixCls}-checked { &:hover { .@{checkboxInnerPrefixCls} { border-color: #3dbcf6; } } .@{checkboxInnerPrefixCls} { background-color: #3dbcf6; border-color: #3dbcf6; &::after { position: absolute; top: 1px; left: 4px; display: table; width: 5px; height: 8px; border: 2px solid #fff; border-top: 0; border-left: 0; transform: rotate(45deg); animation-name: amCheckboxOut; animation-duration: 0.3s; animation-timing-function: cubic-bezier(0.68, -0.55, 0.27, 1.55); content: ' '; } } } .@{checkboxWarpPrefixCls}-disabled { &.@{checkboxWarpPrefixCls}-checked { &:hover { .@{checkboxInnerPrefixCls} { border-color: #d9d9d9; } } .@{checkboxInnerPrefixCls} { background-color: #f3f3f3; border-color: #d9d9d9; &::after { border-color: #ccc; animation-name: none; } } } &:hover { .@{checkboxInnerPrefixCls} { border-color: #d9d9d9; } } .@{checkboxInnerPrefixCls} { background-color: #f3f3f3; border-color: #d9d9d9; &::after { border-color: #f3f3f3; animation-name: none; } } .@{checkboxInnerPrefixCls}-input { cursor: default; } } @keyframes amCheckboxIn { 0% { transform: scale(0, 0) rotate(45deg); transform-origin: 50% 50%; opacity: 0; } 100% { transform: scale(1, 1) rotate(45deg); transform-origin: 50% 50%; opacity: 1; } } @keyframes amCheckboxOut { 0% { opacity: 1; } 100% { opacity: 0; } }