UNPKG

winbox-ui-next

Version:

We Design Vue 2.0: A Vue.js 3 UI Library

273 lines (272 loc) 6.78 kB
/******** borderSize *******/ /******** borderStyle *******/ /******** radius *******/ /******** shadow distance *******/ /******** size *******/ /******** spacing *******/ /******** shadow *******/ /******** opacity *******/ /******** fontSize *******/ /******** fontWeight ********/ /******** radius *******/ /******** Primary *******/ /******** success *******/ /******** warning *******/ /******** danger *******/ /******** link *******/ /******** radius *******/ /********* icon hover *********/ .switch-slide-text-enter-from { left: -100% !important; } .switch-slide-text-enter-to { left: 8px !important; } .switch-slide-text-enter-active { transition: left 0.2s cubic-bezier(0.34, 0.69, 0.1, 1); } .switch-slide-text-leave-from { left: 100% !important; } .switch-slide-text-leave-to { left: 21px !important; } .switch-slide-text-leave-active { transition: left 0.2s cubic-bezier(0.34, 0.69, 0.1, 1); } .w-switch { position: relative; box-sizing: border-box; min-width: 36px; height: 24px; padding: 0; overflow: hidden; line-height: 24px; vertical-align: middle; background-color: transparent; border: 2px solid var(--color-neutral-6); border-radius: 12px; outline: none; cursor: pointer; transition: background-color 0.2s cubic-bezier(0.34, 0.69, 0.1, 1); } .w-switch-handle { position: absolute; top: 5px; left: 5px; display: flex; align-items: center; justify-content: center; width: 10px; height: 10px; color: var(--color-neutral-3); font-size: 12px; background-color: var(--color-neutral-6); border-radius: 50%; transition: all 0.2s cubic-bezier(0.34, 0.69, 0.1, 1); } .w-switch-checked { background-color: rgb(var(--primary-6)); border-color: rgb(var(--primary-6)); } .w-switch-checked .w-switch-handle { left: calc(100% - 10px - 5px); color: rgb(var(--primary-6)); background-color: var(--color-bg-2); } .w-switch[disabled] .w-switch-handle { color: var(--color-fill-2); } .w-switch[disabled].w-switch-checked .w-switch-handle { color: var(--color-primary-light-3); } .w-switch[disabled] .w-switch-handle { color: var(--color-fill-2); } .w-switch[disabled].w-switch-checked .w-switch-handle { color: var(--color-primary-light-3); } .w-switch-text-holder { margin: 0 8px 0 21px; font-size: 12px; opacity: 0; } .w-switch-text { position: absolute; top: 0; left: 21px; color: var(--color-text-2); font-size: 12px; line-height: 20px; } .w-switch-checked .w-switch-text-holder { margin: 0 21px 0 8px; } .w-switch-checked .w-switch-text { left: 8px; color: var(--color-white); } .w-switch[disabled] { background-color: var(--color-fill-2); cursor: not-allowed; } .w-switch[disabled] .w-switch-text { color: var(--color-white); } .w-switch[disabled].w-switch-checked { background-color: var(--color-primary-light-3); border-color: var(--color-primary-light-3); } .w-switch[disabled].w-switch-checked .w-switch-text { color: var(--color-white); } .w-switch-loading { background-color: var(--color-fill-2); } .w-switch-loading .w-switch-handle { color: var(--color-neutral-3); } .w-switch-loading .w-switch-text { color: var(--color-white); } .w-switch-loading.w-switch-checked { background-color: var(--color-primary-light-3); } .w-switch-loading.w-switch-checked .w-switch-handle { color: var(--color-primary-light-3); } .w-switch-loading.w-switch-checked .w-switch-text { color: var(--color-primary-light-1); } .w-switch-small { min-width: 28px; height: 18px; line-height: 18px; } .w-switch-small.w-switch-checked { padding-left: -3px; } .w-switch-small .w-switch-handle { top: 3px; left: 3px; width: 8px; height: 8px; border-radius: 9px; } .w-switch-small .w-switch-handle-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.66667); } .w-switch-small.w-switch-checked .w-switch-handle { left: calc(100% - 8px - 3px); } .w-switch-type-round { min-width: 40px; border-radius: var(--border-radius-small); } .w-switch-type-round .w-switch-handle { border-radius: 2px; } .w-switch-type-round.w-switch-small { min-width: 28px; height: 18px; line-height: 18px; border-radius: 2px; } .w-switch-type-round.w-switch-small .w-switch-handle { border-radius: 1px; } .w-switch-type-line { min-width: 36px; overflow: unset; background-color: transparent; border-color: transparent; } .w-switch-type-line::after { display: block; width: 100%; height: 6px; background-color: var(--color-neutral-6); border-radius: 3px; transition: background-color 0.2s cubic-bezier(0.34, 0.69, 0.1, 1); content: ''; } .w-switch-type-line .w-switch-handle { top: 0px; left: 0; width: 20px; height: 20px; background-color: var(--color-bg-2); border-radius: 10px; box-shadow: 0 1px 3px var(--color-neutral-6); } .w-switch-type-line.w-switch-checked { background-color: transparent; } .w-switch-type-line.w-switch-checked::after { background-color: rgb(var(--primary-6)); } .w-switch-type-line.w-switch-custom-color { --custom-color: var(--color-neutral-6); } .w-switch-type-line.w-switch-custom-color::after { background-color: var(--custom-color); } .w-switch-type-line.w-switch-custom-color.w-switch-checked { --custom-color: rgb(var(--primary-6)); } .w-switch-type-line.w-switch-checked .w-switch-handle { left: calc(100% - 20px); } .w-switch-type-line[disabled] { background-color: transparent; border-color: transparent; cursor: not-allowed; } .w-switch-type-line[disabled]::after { background-color: var(--color-fill-2); } .w-switch-type-line[disabled].w-switch-checked { background-color: transparent; border-color: transparent; } .w-switch-type-line[disabled].w-switch-checked::after { background-color: var(--color-primary-light-3); } .w-switch-type-line.w-switch-loading { background-color: transparent; } .w-switch-type-line.w-switch-loading::after { background-color: var(--color-fill-2); } .w-switch-type-line.w-switch-loading.w-switch-checked { background-color: transparent; } .w-switch-type-line.w-switch-loading.w-switch-checked::after { background-color: var(--color-primary-light-3); } .w-switch-type-line.w-switch-small { min-width: 28px; height: 18px; line-height: 18px; } .w-switch-type-line.w-switch-small.w-switch-checked { padding-left: 1px; } .w-switch-type-line.w-switch-small .w-switch-handle { top: -1px; width: 16px; height: 16px; border-radius: 9px; } .w-switch-type-line.w-switch-small .w-switch-handle-icon { transform: translate(-50%, -50%) scale(1); } .w-switch-type-line.w-switch-small.w-switch-checked .w-switch-handle { left: calc(100% - 16px - -1px); } body[winbox-theme='dark'] .w-switch-checked .w-switch-handle { background-color: var(--color-bg-white); }