loading up the forgejo repo on tangled to test page performance

Tweak and fix toggle checkboxes (#30527)

Fixes: https://github.com/go-gitea/gitea/issues/30524. Slightly restyled
them so that the "knob" is contained inside the background.

<img width="179" alt="Screenshot 2024-04-16 at 21 58 09"
src="https://github.com/go-gitea/gitea/assets/115237/be94517b-9cb7-46e2-ae96-fcf6767ce4ba">
<img width="187" alt="Screenshot 2024-04-16 at 21 58 50"
src="https://github.com/go-gitea/gitea/assets/115237/c13a1959-5c5a-4e88-9225-e5f6fb72e3e0">

(cherry picked from commit 5ccd042f7080e1f4ef4b96591e1b1002a4826115)

authored by

silverwind and committed by
Gergely Nagy
cfb8617f 23f032ea

+10 -9
+10 -9
web_src/css/modules/checkbox.css
··· 66 66 } 67 67 .ui.toggle.checkbox input { 68 68 width: 3.5rem; 69 - height: 1.5rem; 69 + height: 21px; 70 70 opacity: 0; 71 71 z-index: 3; 72 72 } ··· 81 81 content: ""; 82 82 z-index: 1; 83 83 top: 0; 84 - width: 3.5rem; 85 - height: 1.5rem; 84 + width: 49px; 85 + height: 21px; 86 86 border-radius: 500rem; 87 87 left: 0; 88 88 } 89 89 .ui.toggle.checkbox label::after { 90 90 background: var(--color-white); 91 + box-shadow: 1px 1px 4px 1px var(--color-shadow); 91 92 position: absolute; 92 93 content: ""; 93 94 opacity: 1; 94 95 z-index: 2; 95 - width: 1.5rem; 96 - height: 1.5rem; 97 - top: 0; 98 - left: 0; 96 + width: 18px; 97 + height: 18px; 98 + top: 1.5px; 99 + left: 1.5px; 99 100 border-radius: 500rem; 100 101 transition: background 0.3s ease, left 0.3s ease; 101 102 } 102 103 .ui.toggle.checkbox input ~ label::after { 103 - left: -0.05rem; 104 + left: 1.5px; 104 105 } 105 106 .ui.toggle.checkbox input:checked ~ label::after { 106 - left: 2.15rem; 107 + left: 29px; 107 108 } 108 109 .ui.toggle.checkbox input:focus ~ label::before, 109 110 .ui.toggle.checkbox label::before {