UNPKG

vuetify

Version:

Vue Material Component Framework

303 lines 11.2 kB
@layer vuetify-components { .v-switch { --v-switch-scale: 1; } .v-switch .v-label { padding-inline-start: 10px; } .v-switch--size-x-small { --v-switch-scale: 0.6428571429; --v-switch-track-height: 9px; --v-switch-thumb-height: 13px; --v-switch-thumb-width: 13px; } .v-switch--size-small { --v-switch-scale: 0.7857142857; --v-switch-track-height: 11px; --v-switch-thumb-height: 16px; --v-switch-thumb-width: 16px; } .v-switch--size-default { --v-switch-scale: 1; --v-switch-track-height: 14px; --v-switch-thumb-height: 20px; --v-switch-thumb-width: 20px; } .v-switch--size-large { --v-switch-scale: 1.2142857143; --v-switch-track-height: 17px; --v-switch-thumb-height: 24px; --v-switch-thumb-width: 24px; } .v-switch--size-x-large { --v-switch-scale: 1.3571428571; --v-switch-track-height: 19px; --v-switch-thumb-height: 28px; --v-switch-thumb-width: 28px; } .v-switch--inset.v-switch--size-x-small { --v-switch-scale: 0.625; --v-switch-track-height: 20px; --v-switch-thumb-height: 15px; --v-switch-thumb-width: 15px; } .v-switch--inset.v-switch--size-small { --v-switch-scale: 0.8125; --v-switch-track-height: 26px; --v-switch-thumb-height: 20px; --v-switch-thumb-width: 20px; } .v-switch--inset.v-switch--size-default { --v-switch-scale: 1; --v-switch-track-height: 32px; --v-switch-thumb-height: 24px; --v-switch-thumb-width: 24px; } .v-switch--inset.v-switch--size-large { --v-switch-scale: 1.1875; --v-switch-track-height: 38px; --v-switch-thumb-height: 30px; --v-switch-thumb-width: 30px; } .v-switch--inset.v-switch--size-x-large { --v-switch-scale: 1.375; --v-switch-track-height: 44px; --v-switch-thumb-height: 34px; --v-switch-thumb-width: 34px; } .v-switch__loader { display: flex; } .v-switch__loader .v-progress-circular { color: rgb(var(--v-theme-surface)); } .v-switch__track, .v-switch__thumb { transition: none; } .v-selection-control--error:not(.v-selection-control--disabled) .v-switch__track, .v-selection-control--error:not(.v-selection-control--disabled) .v-switch__thumb { background-color: rgb(var(--v-theme-error)); color: rgb(var(--v-theme-on-error)); } .v-switch__track-true { margin-inline-end: auto; } .v-selection-control:not(.v-selection-control--dirty) .v-switch__track-true { opacity: 0; } .v-switch__track-false { margin-inline-start: auto; } .v-selection-control--dirty .v-switch__track-false { opacity: 0; } .v-switch__track { display: inline-flex; align-items: center; font-size: 0.5rem; padding: 0 5px; background-color: rgb(var(--v-theme-surface-variant)); border-radius: 9999px; height: var(--v-switch-track-height); opacity: 0.6; min-width: calc(36px * var(--v-switch-scale)); cursor: pointer; transition: 0.2s background-color cubic-bezier(0.4, 0, 0.2, 1); } .v-switch--inset .v-switch__track { border-radius: 9999px; font-size: 0.75rem; min-width: calc(52px * var(--v-switch-scale)); } .v-switch__thumb { align-items: center; background-color: rgb(var(--v-theme-surface-bright)); color: rgb(var(--v-theme-on-surface-bright)); border-radius: 50%; display: flex; font-size: 0.75rem; height: var(--v-switch-thumb-height); justify-content: center; width: var(--v-switch-thumb-width); pointer-events: none; transition: 0.15s 0.05s transform cubic-bezier(0, 0, 0.2, 1), 0.2s color cubic-bezier(0.4, 0, 0.2, 1), 0.2s background-color cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; } .v-switch:not(.v-switch--inset) .v-switch__thumb { box-shadow: 0px 1px 2px 0px rgba(var(--v-shadow-color), var(--v-shadow-key-opacity, 0.3)), 0px 2px 6px 2px rgba(var(--v-shadow-color), var(--v-shadow-ambient-opacity, 0.15)); --v-elevation-overlay: color-mix(in srgb, var(--v-elevation-overlay-color) 4%, transparent); } .v-switch.v-switch--flat:not(.v-switch--inset) .v-switch__thumb { background: rgb(var(--v-theme-surface-variant)); color: rgb(var(--v-theme-on-surface-variant)); } .v-switch.v-switch--flat:not(.v-switch--inset) .v-switch__thumb { box-shadow: 0px 0px 0px 0px rgba(var(--v-shadow-color), var(--v-shadow-key-opacity, 0.3)), 0px 0px 0px 0px rgba(var(--v-shadow-color), var(--v-shadow-ambient-opacity, 0.15)); --v-elevation-overlay: color-mix(in srgb, var(--v-elevation-overlay-color) 0%, transparent); } .v-switch--inset .v-switch__thumb { transform: scale(var(--v-switch-inset-thumb-off-scale, calc(16px / 24px))); } .v-switch--inset .v-switch__thumb--filled { transform: none; } .v-switch--inset .v-selection-control--dirty .v-switch__thumb { transform: none; transition: 0.15s 0.05s transform cubic-bezier(0, 0, 0.2, 1); } .v-switch--inset-material .v-switch__track { opacity: 1; background-color: color-mix(in srgb, rgb(var(--v-theme-on-surface-variant)) 73%, #ccc); border: 2px solid color-mix(in srgb, rgb(var(--v-theme-surface-variant)) 20%, #888); } .v-switch--inset-material .v-switch__thumb { background-color: color-mix(in srgb, rgb(var(--v-theme-surface-variant)) 20%, #888); color: color-mix(in srgb, rgb(var(--v-theme-on-surface-variant)) 73%, #ccc); } .v-switch--inset-material .v-selection-control--dirty .v-switch__track { border-color: transparent; background-color: color-mix(in srgb, rgb(var(--v-theme-surface-variant)) 90%, white); } .v-switch--inset-material .v-selection-control--dirty .v-switch__thumb { background-color: color-mix(in srgb, rgb(var(--v-theme-on-surface-variant)) 80%, white); color: color-mix(in srgb, rgb(var(--v-theme-surface-variant)) 90%, white); } .v-switch--inset-material .v-selection-control__input:active .v-switch__thumb { transform: scale(var(--v-switch-inset-thumb-pressed-scale, calc(28px / 24px))); } .v-switch--inset-material .v-selection-control__input:before { --v-hover-opacity: 0.08; z-index: 1; } .v-switch--inset-material .v-selection-control--focus-visible .v-selection-control__input:before { opacity: 0; } .v-switch--inset-material .v-selection-control--focus-visible .v-switch__track { outline: 2px solid rgb(var(--v-theme-surface-variant)); outline-offset: 2px; } .v-switch--inset-material .v-selection-control--disabled { opacity: 1; } .v-switch--inset-material .v-selection-control--disabled .v-label { opacity: var(--v-disabled-opacity); } .v-switch--inset-material .v-selection-control--disabled .v-switch__track { background-color: color-mix(in srgb, color-mix(in srgb, rgb(var(--v-theme-on-surface-variant)) 73%, #ccc) 12%, transparent); border-color: rgba(var(--v-theme-on-surface), 0.12); } .v-switch--inset-material .v-selection-control--disabled .v-switch__thumb { background-color: rgba(var(--v-theme-on-surface), 0.38); } .v-switch--inset-material .v-selection-control--disabled .v-switch__thumb .v-icon { opacity: 0.8; } .v-switch--inset-material .v-selection-control--disabled.v-selection-control--dirty .v-switch__track { background-color: rgba(var(--v-theme-on-surface), 0.12); border-color: transparent; } .v-switch--inset-material .v-selection-control--disabled.v-selection-control--dirty .v-switch__thumb { background-color: rgb(var(--v-theme-surface)); } .v-switch--inset-material .v-selection-control--disabled.v-selection-control--dirty .v-switch__thumb .v-icon { opacity: 0.4; } .v-switch--inset-square .v-switch__track { border-radius: 6px; } .v-switch--inset-square .v-switch__thumb { border-radius: 4px; } .v-switch.v-input { flex: 0 1 auto; } .v-switch .v-selection-control { min-height: var(--v-input-control-height); } .v-switch .v-selection-control__input { border-radius: 50%; transition: 0.2s transform cubic-bezier(0.4, 0, 0.2, 1); position: absolute; height: calc(var(--v-switch-thumb-height) * 1.666666667); width: calc(var(--v-switch-thumb-height) * 1.666666667); } .v-locale--is-ltr.v-switch .v-selection-control__input, .v-locale--is-ltr .v-switch .v-selection-control__input { transform: translateX(calc(-10px * var(--v-switch-scale))); } .v-locale--is-rtl.v-switch .v-selection-control__input, .v-locale--is-rtl .v-switch .v-selection-control__input { transform: translateX(calc(10px * var(--v-switch-scale))); } .v-switch .v-selection-control__input .v-icon { position: absolute; } .v-switch .v-selection-control__input input { margin: 0; } .v-locale--is-ltr.v-switch .v-selection-control--dirty .v-selection-control__input, .v-locale--is-ltr .v-switch .v-selection-control--dirty .v-selection-control__input { transform: translateX(calc(10px * var(--v-switch-scale))); } .v-locale--is-rtl.v-switch .v-selection-control--dirty .v-selection-control__input, .v-locale--is-rtl .v-switch .v-selection-control--dirty .v-selection-control__input { transform: translateX(calc(-10px * var(--v-switch-scale))); } .v-switch.v-switch--indeterminate .v-selection-control__input { transform: scale(0.8); } .v-switch.v-switch--indeterminate .v-switch__thumb { transform: scale(0.75); box-shadow: none; } .v-switch.v-switch--inset .v-selection-control__wrapper { width: auto; } .v-switch.v-input--vertical .v-label { min-width: max-content; } .v-switch.v-input--vertical .v-selection-control__wrapper { transform: rotate(-90deg); } @media (forced-colors: active) { .v-switch .v-switch__loader .v-progress-circular { color: currentColor; } .v-switch .v-switch__thumb { background-color: buttontext; } .v-switch .v-switch__track, .v-switch .v-switch__thumb { border: 1px solid; color: buttontext; } .v-switch:not(.v-switch--loading):not(.v-input--disabled) .v-selection-control--dirty .v-switch__thumb { background-color: highlight; } .v-switch:not(.v-input--disabled) .v-selection-control--dirty .v-switch__track { background-color: highlight; } .v-switch:not(.v-input--disabled) .v-selection-control--dirty .v-switch__track, .v-switch:not(.v-input--disabled) .v-selection-control--dirty .v-switch__thumb { color: highlight; } .v-switch.v-switch--inset .v-switch__track { border-width: 2px; } .v-switch.v-switch--inset:not(.v-switch--loading):not(.v-input--disabled) .v-selection-control--dirty .v-switch__thumb { background-color: highlighttext; color: highlighttext; } .v-switch.v-input--disabled .v-switch__thumb { background-color: graytext; } .v-switch.v-input--disabled .v-switch__track, .v-switch.v-input--disabled .v-switch__thumb { color: graytext; } .v-switch.v-switch--loading .v-switch__thumb { background-color: canvas; } .v-switch.v-switch--loading.v-switch--inset .v-switch__thumb, .v-switch.v-switch--loading.v-switch--indeterminate .v-switch__thumb { border-width: 0; } } }