Giter Site home page Giter Site logo

Comments (4)

janosh avatar janosh commented on May 23, 2024 1

The ToC item font size is calculated based on heading level:

style:font-size="{2 - 0.2 * (levels[idx] - minLevel)}ex"

But it uses ex units so any font-size you apply to the parent container should take effect. You can do that by passing a prop --toc-font-size="2em" or through global CSS if you want to target specific elements (with increasing level of specificity)

  :global(aside.toc) {
    font-size: 2em;
  }
  :global(aside.toc > nav) {
    font-size: 1ex;
  } 
  :global(aside.toc > nav > ul) {
    font-size: 5pt;
  }

If you increase the font-size of sub-elements like aside.toc > nav it won't increase the overall TOC's width so you might have to do that manually with e.g. --toc-desktop-max-width="20em".

from svelte-toc.

wentallout avatar wentallout commented on May 23, 2024

umm I would love to be able to customize the color of li elements? so far there's only --toc-active-color but nothing for the inactive elements

from svelte-toc.

janosh avatar janosh commented on May 23, 2024

Sure, happy to take a PR that adds --toc-li-color. Feel free to add more CSS variables if you think they make sense.

from svelte-toc.

janosh avatar janosh commented on May 23, 2024

Closing as

:where(aside.toc > nav > ol > li) {
    color: var(--toc-li-color);

was added in ade5425.

from svelte-toc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.