Fix table of contents heading indentation

What does this MR do and why?

Contributes to #627811 (closed)

Problem

Vue 3 compat forwards TOC extraAttrs through a legacy object-bind helper that treats inline styles as classes. This turns heading padding into invalid CSS and breaks indentation in the file preview TOC.

Solution

  • Replace dynamic padding styles with GitLab Tailwind padding classes.
  • Preserve the 16px through 56px indentation sequence with !important overrides for GitLab UI item padding.
  • Verify rendered classes with real GlDisclosureDropdown, including deep heading levels.

This is a Vue 3 compat regression. The compat flag that introduced the problem has since been removed, so rolling it back is not available.

References

#627811 (closed)

Screenshots or screen recordings

Before After
Screenshot_2026-09-07_at_15.12.51 Screenshot_2026-09-07_at_14.55.30

How to set up and validate locally

  1. Create a project with README
  2. Check TOC rendering (using Vue 3)
  3. Confirm that the indentation is correct

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Vasilii Iakliushin

Merge request reports

Loading
Loading