UNPKG

@shopware-ag/meteor-component-library

Version:

The meteor component library is a Vue component library developed by Shopware. It is based on the [Meteor Design System](https://shopware.design/).

92 lines (89 loc) 2.26 kB
.mt-switch { margin-top: var(--scale-size-24); margin-bottom: var(--scale-size-22); } .mt-switch--not-bordered { min-height: var(--scale-size-48); } .mt-switch--no-top-margin { margin-top: 0; } .mt-switch--future-no-default-margin { margin: 0; } .mt-switch__block { display: flex; align-items: center; } .mt-switch__block--bordered { min-height: var(--scale-size-48); border: 1px solid var(--color-border-primary-default); padding-inline: var(--scale-size-16); border-radius: var(--border-radius-xs); background: var(--color-background-primary-default); } .mt-switch__block--errored { border-color: var(--color-border-critical-default); background: var(--color-background-critical-default); } .mt-switch__switch { -webkit-appearance: none; appearance: none; margin: 0; cursor: pointer; border-radius: var(--border-radius-round); height: var(--scale-size-16); width: var(--scale-size-24); background: var(--color-interaction-secondary-disabled); position: relative; &:disabled { cursor: not-allowed; } &::after { content: ""; display: block; width: var(--scale-size-10); height: var(--scale-size-10); border-radius: var(--border-radius-round); background: var(--color-static-white); position: absolute; top: 50%; left: 3px; transform: translateY(-50%); transition: 200ms left cubic-bezier(0.23, 1, 0.32, 1); } &:focus-visible { outline: 2px solid var(--color-border-brand-default); outline-offset: 2px; } &:checked::after { left: calc(100% - var(--scale-size-10) - 3px); } &:checked:not(.mt-switch__switch--errored) { background: var(--color-interaction-primary-default); &:disabled { background-color: var(--color-interaction-primary-disabled); } } &:disabled:not(:checked):not(.mt-switch__switch--errored) { &::after { background-color: var(--color-icon-primary-disabled); } } } .mt-switch__switch--errored { background: var(--color-interaction-critical-default); } .mt-switch__label { padding-left: var(--scale-size-4); cursor: pointer; } .mt-switch__label--disabled { cursor: not-allowed; } .mt-switch__help-text { margin-left: var(--scale-size-8); height: var(--scale-size-16); display: grid; place-items: center; }