Skip to content

Add Custom CSS Classes #42

@aress31

Description

@aress31

So far to add a custom CSS class to the TOC is to use the following workaround:

  eleventyConfig.addPlugin(toc, {
    wrapper: undefined,
  });

  eleventyConfig.addFilter("bootstrapToc", (tocHtml) => {
    if (tocHtml) {
      return tocHtml
        .replace(/<ol>/g, `<ol class="list-group">`)
        .replace(/<li>/g, `<li class="list-group-item">`);
    }
    return tocHtml;
  });

Would be nice to have a built-in feature to achieve the same results.

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