From 3f86e574a017c36ddfc8a082ea85d7499659a3e9 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Wed, 30 Oct 2024 16:41:35 +0300 Subject: [PATCH 1/5] improve styling --- index.html | 2 +- src/styles/list.pcss | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 56ca39e..2f5aab0 100644 --- a/index.html +++ b/index.html @@ -119,7 +119,7 @@ data: { style: 'ordered', start: 2, - maxLevel: 3, + maxLevel: 5, items: [ { content: "Canon", diff --git a/src/styles/list.pcss b/src/styles/list.pcss index 86ce990..d9d3419 100644 --- a/src/styles/list.pcss +++ b/src/styles/list.pcss @@ -2,6 +2,8 @@ margin: 0; padding: 0; outline: none; + display: grid; + gap: 8px; counter-reset: item; --list-counter-type: numeric; --radius-border: 5px; @@ -21,10 +23,12 @@ grid-template-areas: "checkbox content" ". child"; - margin: 2px 0; &-children { + display: grid; grid-area: child; + gap: 8px; + padding: 8px 0px 0px 0px; } [contenteditable]{ @@ -32,10 +36,10 @@ } &-content { - margin-left: 8px; word-break: break-word; white-space: pre-wrap; grid-area: content; + padding-left: 8px; } &::before { From 93037766618b9ccbafbba7c5ff4b1193ad381966 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Wed, 30 Oct 2024 16:45:21 +0300 Subject: [PATCH 2/5] added spacing variable --- src/styles/list.pcss | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/styles/list.pcss b/src/styles/list.pcss index d9d3419..bdfe88c 100644 --- a/src/styles/list.pcss +++ b/src/styles/list.pcss @@ -3,8 +3,9 @@ padding: 0; outline: none; display: grid; - gap: 8px; counter-reset: item; + gap: var(--spacing-s); + --spacing-s: 8px; --list-counter-type: numeric; --radius-border: 5px; --checkbox-background: #fff; @@ -27,8 +28,8 @@ &-children { display: grid; grid-area: child; - gap: 8px; - padding: 8px 0px 0px 0px; + gap: var(--spacing-s); + padding-top: var(--spacing-s); } [contenteditable]{ @@ -39,7 +40,7 @@ word-break: break-word; white-space: pre-wrap; grid-area: content; - padding-left: 8px; + padding-left: var(--spacing-s); } &::before { From 92dfeb6d92137a78bd5afbf891a7157f3acb0240 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:22:51 +0300 Subject: [PATCH 3/5] fix line heigth --- src/styles/list.pcss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/list.pcss b/src/styles/list.pcss index bdfe88c..b625040 100644 --- a/src/styles/list.pcss +++ b/src/styles/list.pcss @@ -11,7 +11,7 @@ --checkbox-background: #fff; --color-border: #C9C9C9; --color-bg-checked: #369FFF; - --line-height: 1.6em; + --line-height: 145%; --color-bg-checked-hover: #0059AB; --color-tick: #fff; --size-checkbox: 1.2em; From 522673c8cac70350abff866be054faa8c407c657 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Wed, 30 Oct 2024 18:38:45 +0300 Subject: [PATCH 4/5] improve comments --- src/ListTabulator/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ListTabulator/index.ts b/src/ListTabulator/index.ts index 63084f2..45907a1 100644 --- a/src/ListTabulator/index.ts +++ b/src/ListTabulator/index.ts @@ -849,7 +849,8 @@ export default class ListTabulator { const currentItemChildrenList = getChildItems(item); /** - * Check that current item has any children + * If item has no children, just remove item + * Else children of the item should be prepended to the target item child list */ if (currentItemChildrenList.length === 0) { /** From c2efb42cd15e86c42081f31ca21a377386ae10a6 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:25:50 +0300 Subject: [PATCH 5/5] added padding for the whole list --- src/styles/list.pcss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/styles/list.pcss b/src/styles/list.pcss index b625040..f03d3b1 100644 --- a/src/styles/list.pcss +++ b/src/styles/list.pcss @@ -5,7 +5,9 @@ display: grid; counter-reset: item; gap: var(--spacing-s); + padding: var(--spacing-xs); --spacing-s: 8px; + --spacing-xs: 6px; --list-counter-type: numeric; --radius-border: 5px; --checkbox-background: #fff;