Comments (4)
The ToC item font size is calculated based on heading level:
Line 159 in 06da853
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.
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.
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.
Closing as
:where(aside.toc > nav > ol > li) {
color: var(--toc-li-color);
was added in ade5425.
from svelte-toc.
Related Issues (20)
- Quick questions HOT 1
- Getting error about resolving `$app/stores` HOT 7
- Strange behaviour HOT 16
- Prevents scroll when using smart zoom on macOS HOT 1
- [Question] Split into sections HOT 4
- Component persisting on page change when not required HOT 2
- New prop for toc nav overflow-y HOT 1
- Component insists on starting at full height above the text HOT 4
- Svelte-toc interferes with other anchor links in the document HOT 9
- [Question]TypeScript support HOT 4
- Is there an option to hide the scrollbar if the ToC doesn't reach certain size? Or just hide in general? HOT 4
- Disable blur initial transition animation HOT 1
- SvelteKit page navigation breaks when svelte-toc is shown HOT 1
- Add option to only show sublevel headings below currently active top-level heading
- Issues with highlighting the correct content HOT 1
- `keepActiveTocItemInView` should be false by default HOT 3
- Hide when intersecting with user-specified DOM nodes
- Add slots for custom ToC items HOT 1
- Add tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-toc.