HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //var/www/design.system/src/molecules/Inputs/Switch/Switch.module.scss
.root {
    width: min-content;
    min-width: 340px;
    cursor: default;
    position: relative;

    &.disabled {
        .label {
            color: var(--textDisabledPrimary);
        }

        .description {
            color: var(--textDisabledSecondary);
        }

        .switch::after {
            background-color: var(--iconDisabledPrimary);
        }

        input:checked + .wrapper {
            .switch {
                background-color: var(--backgroundDisabledPrimary);
            }
        }

        input:checked + .wrapper {
            .switch::after {
                background-color: var(--iconDisabledPrimary);
            }
        }
    }
}

.input {
    width: 40px;
    height: 28px;
    position: absolute;
    opacity: 0;
    top: 0;
    right: 0;
    margin: 0;
    z-index: 1;
}

.wrapper {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    height: 22px;

    label {
        flex-grow: 1;
    }

    &:hover {
        .switch {
            background-color: var(--backgroundBrandTertiaryHover);
        }

        .input:checked + .wrapper {
            .switch {
                background-color: var(--backgroundBrandPrimaryHover);
            }
        }

        .input:checked + .switch::after {
            background-color: var(--iconBrandOnBrandPrimary);
        }
    }
}

.switch {
    width: 40px;
    height: 24px;
    background-color: var(--backgroundBrandTertiary);
    border-radius: 24px;
    flex-shrink: 0;
    position: relative;
    transition: background 0.3s;
}

.switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background-color: var(--iconBrandPrimary);
    border-radius: var(--radiusFull);
    transition: transform 0.3s;
}

.input:checked + .wrapper {
    .switch {
        background-color: var(--backgroundBrandPrimary);

        &::after {
            transform: translateX(16px);
            background-color: var(--iconBrandOnBrandPrimary);
        }
    }

    &:hover {
        .switch {
            background-color: var(--backgroundBrandPrimaryHover);
        }
    }
}

.label {
    color: var(--textDefaultPrimary);
}

.description {
    color: var(--textDefaultSecondary);
}