facebook / facebook/docusaurus

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

Đang mở
#8,928 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug domain: theme
Ngôn ngữ chính
TypeScript
Star
66.2k
Fork
10k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
52

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.