facebook / facebook/docusaurus

Docs - main.docMainContainer has bad max-width when there is no sidebar

Abierto
#8,928 7 comentarios 0 reacciones 0 asignados Ver en GitHub
bug domain: theme
Lenguaje dominante
TypeScript
Estrellas
66.2k
Forks
10k
Merge medio
1 d 3 h
PR fusionados (30 d)
52

Descripción

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Prerequisites

- [X] I'm using the latest version of Docusaurus.
- [X] I have tried the `npm run clear` or `yarn clear` command.
- [X] I have tried `rm -rf node_modules yarn.lock package-lock.json` and re-installing packages.
- [X] I have tried creating a repro with https://new.docusaurus.io.
- [X] I have read the console error message carefully (if applicable).

### Description

Why is the docmaincontainers' width not 100% When the doc has no sidebar? We substract '30px' which leads to the fact we are not using the full width. This logic only makes sense if you have hideable sidebar enabled (configured) in the first place, and secondly IF the page contains a sidebar.
https://docusaurus.io/docs/sidebar#hideable-sidebar
![image](https://user-images.githubusercontent.com/68061801/234268455-f4cd4c08-f102-4a21-a69b-8ea322032be5.png)

### Reproducible demo

_No response_

### Steps to reproduce

Visit: https://docs.boc-group.com/adonis/en/docs/15.0/news/
Inspect docMainContainer, you will notice that calc(100% - var(--doc-sidebar-hidden-width)) where doc-sidebar-hidden-width is 30px, but it should be 0 in case there is no sidebar. Additionally it should globally be 0 if this was not configured in docusaurus.config.js because by default it is set to false.
![image](https://user-images.githubusercontent.com/68061801/234268885-325dfd71-17ba-4057-8bda-7e7ca0856329.png)

### Expected behavior

I expect that the global variable --doc-sidebar-hidden-width = 0px IF hideable sidebar is not configured on docusaurs.config AND if the page contains no sidebar. Otherwise it can be 30px

### Actual behavior

I expect that the global variable --doc-sidebar-hidden-width = 0px IF hideable sidebar is not configured on docusaurs.config AND if the page contains no sidebar. Otherwise it can be 30px

### Your environment

- Public source code:
- Public site URL: https://docs.boc-group.com/adonis/en/docs/15.0/news/
- Docusaurus version used: **latest**
- Environment name and version (e.g. Chrome 89, Node.js 16.4):
- Operating system and version (e.g. Ubuntu 20.04.2 LTS):

### Self-service

- [ ] I'd be willing to fix this bug myself.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.