This commit is contained in:
2023-07-23 00:43:54 +02:00
parent c0fb737314
commit 998a400395
13 changed files with 446 additions and 47 deletions

View File

@@ -1,8 +1,21 @@
$padding: 16px;
.tippy-box[data-theme~="surface-variant"] {
color: var(--md-sys-color-on-surface-variant);
background-color: var(--md-sys-color-surface-variant);
filter: drop-shadow(0 0 12px #000a);
border-radius: calc(24px + $padding);
.tippy-content {
padding: $padding;
}
h2 {
margin-block-start: 8px;
margin-block-end: calc(8px + $padding);
display: flex;
justify-content: center;
}
@each $placement in top, bottom, right, left {
&[data-placement^="#{$placement}"] > .tippy-arrow::before {

64
src/lib/style/toggle.scss Normal file
View File

@@ -0,0 +1,64 @@
$padding: 3px;
$border: 2px;
$height: 1.5em;
label:has(input[type="checkbox"]) {
cursor: pointer;
display: flex;
gap: $padding;
align-items: center;
justify-content: center;
font-size: 12px;
input {
$width: calc($height * (5 / 3));
$diameter: calc($height - ((2 * $padding) + (2 * $border)));
$radius: calc($diameter / 2);
cursor: pointer;
position: relative;
overflow: hidden;
display: flex;
width: $width;
height: $height;
font-size: inherit;
color: inherit;
border-radius: calc($height / 2);
outline: $border solid currentcolor;
outline-offset: calc(-1 * $border);
&::after {
content: "";
position: absolute;
top: calc($padding + $border);
left: calc($padding + $border);
display: block;
width: $diameter;
height: $diameter;
border-radius: calc($radius);
outline-color: inherit;
outline-style: solid;
outline-width: $radius;
outline-offset: calc(-1 * $radius);
transition: all 250ms ease;
}
&:checked::after {
translate: calc($width - 2 * $diameter - $padding / 2) 0;
outline-width: calc($width - ($height - $border) + $padding);
outline-offset: calc($padding / 2);
}
}
}