2024-07-06 09:01:56 +00:00
|
|
|
.t-switch{font:var(--td-font-body-medium);color:var(--td-text-color-primary);box-sizing:border-box;list-style:none;position:relative;display:inline-flex;vertical-align:middle;align-items:center;outline:none;border:0;padding:0;margin:0;height:var(--td-comp-size-xxs);line-height:var(--td-comp-size-xxs);border-radius:var(--td-radius-round);min-width:calc(var(--td-comp-size-xxs) / .618);transition:all .2s cubic-bezier(.38,0,.24,1);background-color:var(--td-bg-color-secondarycomponent);cursor:pointer;user-select:none}.t-switch:hover{background-color:var(--td-bg-color-secondarycomponent-hover)}.t-switch__handle{position:absolute;display:flex;align-items:center;justify-content:center;top:4px;left:4px;width:calc(var(--td-comp-size-xxs) - 2 * 4px);height:calc(var(--td-comp-size-xxs) - 2 * 4px);border-radius:var(--td-radius-round);transition:all .2s cubic-bezier(.38,0,.24,1);box-shadow:var(--td-shadow-1)}.t-switch__handle .t-icon{font-size:calc(var(--td-comp-size-xxs) - 4px);color:transparent}.t-switch__handle:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-radius:var(--td-radius-round);background-color:#fff;transition:all .2s cubic-bezier(.38,0,.24,1)}.t-switch:active:not(.t-is-disabled):not(.t-is-loading) .t-switch__handle:before{left:0;right:-6px}.t-switch:active:not(.t-is-disabled):not(.t-is-loading).t-is-checked .t-switch__handle:before{right:0;left:-6px}.t-switch:active:not(.t-is-disabled):not(.t-is-loading) .t-switch__content{opacity:0}.t-switch__content{box-sizing:border-box;display:inline-flex;align-items:center;color:var(--td-text-color-anti);padding:0 var(--td-comp-margin-xs) 0 calc(calc(var(--td-comp-size-xxs) / .618) / 2 + 2px);font-size:var(--td-font-size-body-small);min-width:calc(var(--td-comp-size-xxs) / .618);transition:padding .2s cubic-bezier(.38,0,.24,1),opacity .2s linear}.t-switch__content .t-icon{font-size:var(--td-font-size-body-large)}.t-switch.t-is-checked{background-color:var(--td-brand-color)}.t-switch.t-is-checked:hover{background-color:var(--td-brand-color-hover)}.t-switch.t-is-checked .t-switch__handle{left:calc(100% - 2.5px);transform:translate(-100%);width:calc(var(--td-comp-size-xxs) - 2 * 2.5px);height:calc(var(--td-comp-size-xxs) - 2 * 2.5px);top:2.5px}.t-switch.t-is-checked .t-switch__content{padding:0 calc(calc(var(--td-comp-size-xxs) / .618) / 2 + 2px) 0 var(--td-comp-margin-xs);color:var(--td-text-color-anti)}.t-switch.t-is-loading{cursor:not-allowed;background-color:var(--td-bg-color-component-disabled)}.t-switch.t-is-loading .t-loading{display:inline-flex}.t-switch.t-is-loading .t-switch__handle .t-icon{color:var(--td-bg-color-component-disabled)}.t-switch.t-is-loading.t-is-checked{background-color:var(--td-brand-color-focus)}.t-switch.t-is-loading.t-is-checked .t-switch__handle .t-icon{color:var(--td-brand-color-focus)}.t-switch.t-is-disabled{cursor:not-allowed;background-color:var(--td-bg-color-component-disabled)}.t-switch.t-is-disabled .t-switch__handle{box-shadow:none}.t-switch.t-is-disabled.t-is-checked{background-color:var(--td-brand-color-disabled)}.t-switch.t-is-disabled.t-is-checked .t-switch__handle{box-shadow:none}.t-switch.t-is-disabled.t-is-checked .t-switch__handle .t-icon{color:var(--td-brand-color-disabled)}.t-switch.t-size-l{min-width:calc(var(--td-comp-size-xs) / .618);height:var(--td-comp-size-xs);line-height:var(--td-comp-size-xs);border-radius:var(--td-radius-round)}.t-switch.t-size-l:active:not(.t-is-disabled):not(.t-is-loading) .t-switch__handle:before{left:0;right:-8px}.t-switch.t-size-l:active:not(.t-is-disabled):not(.t-is-loading).t-is-checked .t-switch__handle:before{right:0;left:-8px}.t-switch.t-size-l .t-switch__handle{top:5px;left:5px;width:calc(var(--td-comp-size-xs) - 2 * 5px);height:calc(var(--td-comp-size-xs) - 2 * 5px)}.t-switch.t-size-l .t-switch__handle .t-icon{font-size:calc(var(--td-comp-size-xs) - 4px)}.t-switch.t-size-l .t-switch__content{padding:0 var(--td-comp-margin-s) 0 calc(calc(var(--td-comp-size-xs) / .618) / 2 + 4px);min-width:calc(var(--td-comp-size-xs) / .618);font-size:9px}.t-switch.t-size-l .t-switch__content
|