In this tutorial, I'm going to show you how to improve the active styles for the Elementor table of content element.
We are going to improve when the active styles are on*, and we are going to add a triangle indicator too, as well as a line.
*By default, Elementor has a few options for the active styling of the table of content list items. You can change the typography to make the active list item bold, for instance.
One major problem though is that the timing isn't quite right. As soon as the title gets in the viewport, it's applying these styles. Then when going back up, as soon as another heading gets in the viewport, it's switching to that one. This results in inconsistent and inaccurate active styling.
Here is an example of Elementor's native option in action (NOT what we are doing):
So I worked very carefully to get my version to be consistent: it won't be jumping from one active list item to another seemingly randomly. When a heading gets to 30% from the bottom in the viewport, the related table of content list item gets active. When it leaves that area, the one before gets active.
Here is my improved version in action. That's what this tutorial will show you how to do:
You will be able to customize the colors and styles of the line, triangle and active item typography.
Let's get started!