Search code examples
mavenasciidoctor

How to hide horizontal scrollbar in right side TOC?


I'm using the asciidoctor-maven-plugin to generate asciidoctor. The output contains a right side TOC.

When the links in this TOC get to large the TOC displays a horizontal scrollbar.

Can I easily disable this by adding some simple css via the asciidoctor-maven-plugin?


Solution

  • Yes, this is the default definition in asciidoctor.css:

    #toc.toc2 {
      width: 20em;
    }
    

    Change this to your requirements in an own copy of the css file (my-theme.css) and use it in the asciidoctor-maven-plugin via:

    <configuration>
      <attributes>
        <stylesheet>my-theme.css</stylesheet>
      </attributes>
    </configuration>