Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
style/task state checkboxes: improve glyph alignment
Adorian Doran3425e2d3deaa
diff --git a/apps/client/src/print.css b/apps/client/src/print.cssindex 47169db18f..34f65fa993 100644--- a/apps/client/src/print.css+++ b/apps/client/src/print.css@@ -119,11 +119,13 @@ body[data-note-type="text"] .ck-content {.ck-content .todo-list__label__description::after {content: var(--task-state-glyph);line-height: var(--box-size);- vertical-align: middle;text-align: center;font-family: var(--task-state-glyph-font-family);- font-size: calc(var(--box-size) * var(--glyph-ratio));+ /* Em box == checkbox box, shrink via scale(): geometric centring,+ consistent with the on-screen checkbox glyph. */+ font-size: var(--box-size);color: var(--task-state-color);+ transform: scale(var(--glyph-ratio));}.ck-content .todo-list__label input[type="checkbox"] {diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.cssindex e69d67e1d1..0da8b0bbeb 100644--- a/apps/client/src/stylesheets/style.css+++ b/apps/client/src/stylesheets/style.css@@ -3016,16 +3016,21 @@ iframe.print-iframe {/* Checkbox tick */&::after {all: unset;- display: inline-flex;+ display: flex;align-items: center;justify-content: center;position: absolute;inset: 0;content: var(--task-state-glyph);font-family: var(--task-state-glyph-font-family, inherit);- font-size: calc(var(--_checkbox-size) * var(--task-checkbox-glyph-ratio));+ /* Em box == checkbox box: the flex centering has zero leftover+ space to round, so nothing can snap asymmetrically. */+ font-size: var(--_checkbox-size);+ line-height: 1;color: var(--task-checkbox-glyph-color);- text-box-trim: trim-both;+ /* The shrink is geometric, not typographic — scale() doesn't snap+ to the device-pixel grid, so the glyph stays centred at any zoom. */+ transform: scale(var(--task-checkbox-glyph-ratio));}&:disabled {diff --git a/packages/share-theme/src/styles/task-states.css b/packages/share-theme/src/styles/task-states.cssindex 05b109bef0..a0adb45ee2 100644--- a/packages/share-theme/src/styles/task-states.css+++ b/packages/share-theme/src/styles/task-states.css@@ -51,6 +51,10 @@ html.theme-dark [data-trilium-task-state] {justify-content: center;content: var(--task-state-glyph);font-family: var(--task-state-glyph-font-family);- font-size: calc(var(--ck-content-todo-list-checkmark-size) * 0.8);+ /* Em box == checkbox box, shrink via scale(): geometric, so the glyph+ stays centred at any zoom/DPI instead of snapping to the pixel grid. */+ font-size: var(--ck-content-todo-list-checkmark-size);+ line-height: 1;color: var(--_task-state-color);+ transform: scale(0.8);}