[data-rs-toggle] {
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
cursor: pointer;
}
[data-rs-toggle] input {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
[data-rs-toggle-content] {
display: inline-flex;
align-items: center;
justify-content: center;
padding: var(--toggle-padding);
color: var(--toggle-fg);
border: var(--toggle-border-width) solid transparent;
border-radius: var(--toggle-radius);
transition:
background var(--motion-duration-fast) var(--motion-ease-standard),
color var(--motion-duration-fast) var(--motion-ease-standard),
transform 80ms var(--motion-ease-standard),
opacity var(--motion-duration-fast) var(--motion-ease-standard);
}
[data-rs-toggle][data-rs-state~="off"] [data-rs-toggle-content] {
background: var(--toggle-off-bg);
}
[data-rs-toggle][data-rs-state~="hover"]:not([data-rs-state~="on"]) [data-rs-toggle-content] {
background: var(--toggle-hover-bg);
}
[data-rs-toggle][data-rs-state~="active"] [data-rs-toggle-content] {
transform: scale(0.96);
background: var(--toggle-active-bg);
}
[data-rs-toggle][data-rs-state~="on"] [data-rs-toggle-content] {
background: var(--toggle-on-bg);
color: var(--toggle-on-fg);
}
[data-rs-toggle][data-rs-state~="hover"][data-rs-state~="on"] [data-rs-toggle-content] {
opacity: var(--opacity-hover);
}
[data-rs-toggle][data-rs-state~="focus"] [data-rs-toggle-content] {
outline: none;
box-shadow: 0 0 0 var(--toggle-focus-ring-width) var(--toggle-on-bg);
}
[data-rs-toggle][data-rs-disabled],
[data-rs-toggle][data-rs-state~="disabled"] {
opacity: var(--toggle-disabled-opacity);
cursor: not-allowed;
pointer-events: none;
}