Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support disabling aside in themeConfig #1915

Closed
3 tasks done
dominikcz opened this issue Feb 10, 2023 · 4 comments · Fixed by #1925
Closed
3 tasks done

support disabling aside in themeConfig #1915

dominikcz opened this issue Feb 10, 2023 · 4 comments · Fixed by #1925
Labels
enhancement New feature or request theme Related to the theme

Comments

@dominikcz
Copy link
Contributor

Describe the bug

Even when you set theme.outline = false vitepress still adds class has-aside and therefore content is unnecessary constrained to narrow space

Reproduction

Set theme.outline to false to hide aside. Even thou it's not displayed it still ocupies space and therefore width of .VPDoc container is the same as with theme.outline

Expected behavior

When aside is hidden it should free up space

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
    Memory: 5.57 GB / 15.80 GB
  Binaries:
    Node: 16.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.2.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (109.0.1518.78)
    Internet Explorer: 11.0.19041.1566

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@dominikcz dominikcz added the bug: pending triage Maybe a bug, waiting for confirmation label Feb 10, 2023
@dominikcz dominikcz changed the title sidebar always rendered even when outline is false aside always rendered even when outline is false Feb 10, 2023
@kiaking
Copy link
Member

kiaking commented Feb 10, 2023

This is intended. Aside contains more than outline.

therefore content is unnecessary constrained to narrow space

This is also intended to prevent layout shifts on page switches.

@kiaking kiaking closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2023
@kiaking kiaking removed the bug: pending triage Maybe a bug, waiting for confirmation label Feb 10, 2023
@dominikcz
Copy link
Contributor Author

I must admit that I fail to understand logic behind this decision:

  • you agree that aside on front page is useless and therefore don't add has-aside class there
  • you also agree that users, who want two-column layout on specific pages can use frontmatter.aside = false and then you respect that decision
  • but when a user has hundreds of pages and basically wants a two-column layout everywhere you say it's not possible by design, forcing them to either use artificial frontmatter.aside on hundreds of pages or some tricks with styling to combat that design choice, instead of allowing a single setting like outline=false? Not really great DX if you ask me, unless there is some other way to do it that I'm not aware of?
  • as for layout shifts between different pages you can prevent that with appropriate styling

If you are, however, worried about some backward compatibility, because someone already relies on that functionality, then maybe additional option would be better, like for example theme.value.outline === 'remove'?

@brc-dd
Copy link
Member

brc-dd commented Feb 11, 2023

Feel free to create a PR with supporting theme.value.aside === false. We should not remove the aside when just outline is disabled.

@brc-dd brc-dd reopened this Feb 11, 2023
@brc-dd brc-dd changed the title aside always rendered even when outline is false support disabling aside in themeConfig Feb 11, 2023
@brc-dd brc-dd added enhancement New feature or request theme Related to the theme labels Feb 11, 2023
@dominikcz
Copy link
Contributor Author

Thank you for understanding, will do that.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request theme Related to the theme
Projects
None yet
3 participants