mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-28 06:08:13 -05:00
Design refresh + a bunch of stuff (#2864)
Co-authored-by: hfcRed <hfcred@gmx.net>
This commit is contained in:
60
app/components/elements/Switch.module.css
Normal file
60
app/components/elements/Switch.module.css
Normal file
@@ -0,0 +1,60 @@
|
||||
.root {
|
||||
--height: var(--selector-size-sm);
|
||||
|
||||
cursor: pointer;
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
align-items: center;
|
||||
gap: 0.571rem;
|
||||
color: var(--text-color);
|
||||
forced-color-adjust: none;
|
||||
font-size: var(--font-xs);
|
||||
font-weight: var(--weight-bold);
|
||||
margin-block-end: 0;
|
||||
}
|
||||
|
||||
.indicator {
|
||||
width: calc(var(--height) * 1.75);
|
||||
height: var(--height);
|
||||
background: var(--color-bg);
|
||||
border: var(--border-style);
|
||||
border-radius: calc(var(--radius-selector) * 2);
|
||||
padding: 2px;
|
||||
display: inline-grid;
|
||||
justify-items: center;
|
||||
grid-template-columns: 0fr 1fr 1fr;
|
||||
transition: grid-template-columns 200ms;
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
height: 100%;
|
||||
aspect-ratio: 1 / 1;
|
||||
background: var(--color-border);
|
||||
border-radius: var(--radius-selector);
|
||||
grid-row-start: 1;
|
||||
grid-column-start: 2;
|
||||
}
|
||||
}
|
||||
|
||||
.root[data-selected] .indicator {
|
||||
background: var(--color-text-accent);
|
||||
border-color: var(--color-text-accent);
|
||||
grid-template-columns: 1fr 1fr 0fr;
|
||||
|
||||
&:before {
|
||||
background: var(--color-text-inverse);
|
||||
}
|
||||
}
|
||||
|
||||
.root[data-focus-visible] .indicator {
|
||||
outline: var(--focus-ring);
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
.root[data-disabled] .indicator {
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
.root[data-disabled] {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
Reference in New Issue
Block a user