Loading
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
!importantoverrides 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
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Create a project with README
- Check TOC rendering (using Vue 3)
- Confirm that the indentation is correct
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.
Edited by Vasilii Iakliushin

