Skip to content

"ol.toc-list" could be truncated, especially if the root heading is shown #330

@stenzengel

Description

@stenzengel

Hi Tim,

I had the problem that the "ol.toc-list" was truncated when there were many headings, especially when the root heading was displayed.

I could workaround the problem by overriding the max-height and transition properties in

max-height: 1000px;

with

.is-collapsible {
	/*
		Increase the value "1000px" of "tocbot.css" to higher value, because otherwise "ol.toc-list" could be truncated (especially if the root heading is shown).
		Do not unset the value, because the smooth transition of closing/opening collapsible list is prevented.
		Do not increase the value to max signed 32 bit, because the visible transition at the end is too fast.
	 */
	max-height: 3000px;
	/*
		Both control points of the Bézier curve are in the lower-right corner.
		I.e. when the list gets uncollapsed (.i.e. it has no style `.is-collapsed` anymore), the transition
		is very slow at the beginning  (i.e. near `max-height: 0`)
		and very fast at the end (i.e. `near max-height: 3000px`, where the transition is normally not visible anymore)
	 */
	transition: all 0.5s cubic-bezier(1, 0, 1, 0);
}

.is-collapsed {
	/* override the increase in ".is-collapsible" */
	max-height: 0;
	/*
		Both control points of the Bézier curve are in the upper-left corner.
		I.e. when the list gets collapsed, the transition
		is very fast at the beginning (i.e. `near max-height: 3000px`, where the transition is normally not visible)
		and very slow at the end (i.e. near `max-height: 0`)
	 */
	transition: all 0.5s cubic-bezier(0, 1, 0, 1);
}

This workaround still has a limit on max-height, but solves my personal problem, because the toc can be 3 times higher and the visible transition is still there.

If you like, I can prepare a PR. Or perhaps there is a better solution?

Best regards,
Winfried

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions