withastro / starlight

🌟 Build beautiful, accessible, high-performance documentation websites with Astro
https://starlight.astro.build
MIT License
5.05k stars 532 forks source link

'tableOfContents' could be all the way to the right #321

Closed usrme closed 1 year ago

usrme commented 1 year ago

What version of starlight are you using?

0.5.0

What version of astro are you using?

2.8.0

What package manager are you using?

npm

What operating system are you using?

Linux

What browser are you using?

Firefox

Describe the Bug

I'm using Starlight (wonderful framework, by the way!) to create a simple page to host various snippets and it's clear from both that site and the official Starlight documentation that the table of contents on the right-hand side leaves far too much negative space on the right (see images below). I'm not sure why the width of the content is sacrificed for this.

The removal of this somewhat alleviates the issue, but only marginally as then the main content area widens, but not the containing text etc.

Link to Minimal Reproducible Example

image


image

Participation

delucis commented 1 year ago

Hi @usrme! Thanks for the issue — glad you’ve been enjoying Starlight.

I'm not sure why the width of the content is sacrificed for this.

This is a design decision to keep the length of individual lines of text at a comfortable length for reading, not really something dictated by the right sidebar.

You can customize the width of the content column by setting the --sl-content-width custom property in some custom CSS, e.g.

:root {
  --sl-content-width: 95ch;
}

There’s an example of a user who did just that here: https://brycerussell.github.io/qbcore-docs/guides/linux-installation/

Is that what you were looking for?

usrme commented 1 year ago

Thank you for explaining the rationale. That difference made a world of difference to me and there's no real need to change anything specific to Starlight itself! :tada:

image