123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- /* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
- /* stylelint-disable no-duplicate-selectors */
- .ant-switch {
- margin: 0;
- padding: 0;
- color: rgba(0, 0, 0, 0.85);
- font-size: 14px;
- font-variant: tabular-nums;
- line-height: 1.5715;
- list-style: none;
- font-feature-settings: 'tnum';
- position: relative;
- display: inline-block;
- box-sizing: border-box;
- min-width: 44px;
- height: 22px;
- line-height: 22px;
- vertical-align: middle;
- background-color: rgba(0, 0, 0, 0.25);
- border: 0;
- border-radius: 100px;
- cursor: pointer;
- transition: all 0.2s;
- user-select: none;
- }
- .ant-switch:focus {
- outline: 0;
- box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
- }
- .ant-switch-checked:focus {
- box-shadow: 0 0 0 2px #e6f7ff;
- }
- .ant-switch:focus:hover {
- box-shadow: none;
- }
- .ant-switch-checked {
- background-color: #1890ff;
- }
- .ant-switch-loading,
- .ant-switch-disabled {
- cursor: not-allowed;
- opacity: 0.4;
- }
- .ant-switch-loading *,
- .ant-switch-disabled * {
- box-shadow: none;
- cursor: not-allowed;
- }
- .ant-switch-inner {
- display: block;
- margin: 0 7px 0 25px;
- color: #fff;
- font-size: 12px;
- transition: margin 0.2s;
- }
- .ant-switch-checked .ant-switch-inner {
- margin: 0 25px 0 7px;
- }
- .ant-switch-handle {
- position: absolute;
- top: 2px;
- left: 2px;
- width: 18px;
- height: 18px;
- transition: all 0.2s ease-in-out;
- }
- .ant-switch-handle::before {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- background-color: #fff;
- border-radius: 9px;
- box-shadow: 0 2px 4px 0 rgba(0, 35, 11, 0.2);
- transition: all 0.2s ease-in-out;
- content: '';
- }
- .ant-switch-checked .ant-switch-handle {
- left: calc(100% - 18px - 2px);
- }
- .ant-switch:not(.ant-switch-disabled):active .ant-switch-handle::before {
- right: -30%;
- left: 0;
- }
- .ant-switch:not(.ant-switch-disabled):active.ant-switch-checked .ant-switch-handle::before {
- right: 0;
- left: -30%;
- }
- .ant-switch-loading-icon.anticon {
- position: relative;
- top: 2px;
- color: rgba(0, 0, 0, 0.65);
- vertical-align: top;
- }
- .ant-switch-checked .ant-switch-loading-icon {
- color: #1890ff;
- }
- .ant-switch-small {
- min-width: 28px;
- height: 16px;
- line-height: 16px;
- }
- .ant-switch-small .ant-switch-inner {
- margin: 0 5px 0 18px;
- font-size: 12px;
- }
- .ant-switch-small .ant-switch-handle {
- width: 12px;
- height: 12px;
- }
- .ant-switch-small .ant-switch-loading-icon {
- top: 1.5px;
- font-size: 9px;
- }
- .ant-switch-small.ant-switch-checked .ant-switch-inner {
- margin: 0 18px 0 5px;
- }
- .ant-switch-small.ant-switch-checked .ant-switch-handle {
- left: calc(100% - 12px - 2px);
- }
- .ant-switch-rtl {
- direction: rtl;
- }
- .ant-switch-rtl .ant-switch-inner {
- margin: 0 25px 0 7px;
- }
- .ant-switch-rtl .ant-switch-handle {
- right: 2px;
- left: auto;
- }
- .ant-switch-rtl:not(.ant-switch-rtl-disabled):active .ant-switch-handle::before {
- right: 0;
- left: -30%;
- }
- .ant-switch-rtl:not(.ant-switch-rtl-disabled):active.ant-switch-checked .ant-switch-handle::before {
- right: -30%;
- left: 0;
- }
- .ant-switch-rtl.ant-switch-checked .ant-switch-inner {
- margin: 0 7px 0 25px;
- }
- .ant-switch-rtl.ant-switch-checked .ant-switch-handle {
- right: calc(100% - 18px - 2px);
- }
- .ant-switch-rtl.ant-switch-small.ant-switch-checked .ant-switch-handle {
- right: calc(100% - 12px - 2px);
- }
- nz-switch {
- display: inline-block;
- }
|