From 0425046e9eb52db09654ec4415fd1a80ebc9d641 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Tue, 13 May 2025 14:39:19 +0800 Subject: [PATCH] fix(theme): task list rendering error within firefox --- theme/src/client/styles/md-enhance.css | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/theme/src/client/styles/md-enhance.css b/theme/src/client/styles/md-enhance.css index 1b1579e2..d47cd869 100644 --- a/theme/src/client/styles/md-enhance.css +++ b/theme/src/client/styles/md-enhance.css @@ -160,22 +160,23 @@ .vp-doc .task-list-container .task-list-item input { position: absolute; - top: 0; - left: 0; - width: 0; - height: 0; - padding: 0; - margin: 0; + top: 0.1em; + left: -0.15em; + z-index: 1; + opacity: 0; } .vp-doc .task-list-container .task-list-item label { margin-left: 1.2em; } -.vp-doc .task-list-container .task-list-item input::before { +.vp-doc .task-list-container .task-list-item label::before { + position: absolute; + top: -0.1em; + left: -0.15em; display: inline-block; - width: 1.25em; - height: 1.25em; + width: 1.2em; + height: 1.2em; content: ""; background-image: var(--icon); background-repeat: no-repeat; @@ -185,11 +186,11 @@ } -.vp-doc .task-list-container .task-list-item input::before { +.vp-doc .task-list-container .task-list-item label::before { --icon: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="1em" height="1em" viewBox="0 0 32 32"%3E%3Cpath fill="%23c2c2c4" d="M26 27.5H6A1.5 1.5 0 0 1 4.5 26V6c0-.83.67-1.5 1.5-1.5h20c.828 0 1.5.67 1.5 1.5v20a1.5 1.5 0 0 1-1.5 1.5m-18.5-3h17v-17h-17z"%2F%3E%3C%2Fsvg%3E'); } -.vp-doc .task-list-container .task-list-item input:checked[disabled]::before { +.vp-doc .task-list-container .task-list-item input:checked[disabled] + label::before { --icon: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="1em" height="1em" viewBox="0 0 32 32"%3E%3Cpath fill="%23299764" d="M29.548 3.043a2.5 2.5 0 0 0-3.513.4L16 16.067l-3.508-4.414a2.5 2.5 0 0 0-3.915 3.112l5.465 6.875c.474.597 1.195.943 1.957.943s1.482-.35 1.957-.944L29.95 6.555c.86-1.08.68-2.654-.402-3.513zM24.5 24.5h-17v-17h12.756l2.385-3H6c-.83 0-1.5.67-1.5 1.5v20c0 .828.67 1.5 1.5 1.5h20a1.5 1.5 0 0 0 1.5-1.5V12.85l-3 3.774z"%2F%3E%3C%2Fsvg%3E'); }