From 5e9068ce86d244dd23a9ca966b57d6c1c72fb7b0 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Mon, 1 May 2023 16:30:04 +1000 Subject: [PATCH] Add comments to link hard-coded indentation level and CSS --- packages/block-editor/src/components/list-view/style.scss | 3 +++ .../src/components/list-view/use-list-view-drop-zone.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/packages/block-editor/src/components/list-view/style.scss b/packages/block-editor/src/components/list-view/style.scss index 3784f3be63eaa1..e56f7c4bb5a842 100644 --- a/packages/block-editor/src/components/list-view/style.scss +++ b/packages/block-editor/src/components/list-view/style.scss @@ -376,6 +376,9 @@ $block-navigation-max-indent: 8; } } +// When updating the margin for each indentation level, the corresponding +// indentation in `use-list-view-drop-zone.js` must be updated as well +// to ensure the drop zone is aligned with the indentation. @for $i from 0 to $block-navigation-max-indent { .block-editor-list-view-leaf[aria-level="#{ $i + 1 }"] .block-editor-list-view__expander { @if $i - 1 >= 0 { diff --git a/packages/block-editor/src/components/list-view/use-list-view-drop-zone.js b/packages/block-editor/src/components/list-view/use-list-view-drop-zone.js index 7df2a0519c0a8c..b97ec90def2bdf 100644 --- a/packages/block-editor/src/components/list-view/use-list-view-drop-zone.js +++ b/packages/block-editor/src/components/list-view/use-list-view-drop-zone.js @@ -58,6 +58,8 @@ import { store as blockEditorStore } from '../../store'; * 'inside' refers to nesting as an inner block. */ +// When the indentation level, the corresponding left margin in `style.scss` +// must be updated as well to ensure the drop zone is aligned with the indentation. export const NESTING_LEVEL_INDENTATION = 28; /**