hugo-theme-relearn/exampleSite/content/configuration/sidebar/width/_index.en.md

35 lines
960 B
Markdown
Raw Normal View History

2024-09-29 21:48:56 +00:00
+++
2024-10-12 17:28:28 +00:00
categories = ["howto"]
2024-09-29 21:48:56 +00:00
description = "Changing the width of the sidebar"
title = "Width"
weight = 1
+++
2024-10-07 13:30:53 +00:00
The theme adjusts the menu width based on browser size.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
If you want to change the chosen default width, you can add CSS variables to `layouts/partials/custom-header.html`.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
## Changing Menu Width
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
The menu width changes for different screen sizes:
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
| Screen Size | Screen Width | Menu Width |
| ----------- | ------------- | ---------- |
| Small | < 48rem | 14.375rem |
| Medium | 48rem - 60rem | 14.375rem |
| Large | >= 60rem | 18.75rem |
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
You can change the menu width but not the screen width breakpoints.
2024-09-29 21:48:56 +00:00
2024-10-07 13:30:53 +00:00
To adjust the menu width, use these CSS variables. Note that `--MENU-WIDTH-S` is for the mobile menu flyout on small screens.
2024-09-29 21:48:56 +00:00
````html {title="layouts/partials/custom-header.html"}
<style>
:root {
--MENU-WIDTH-S: 14.375rem;
--MENU-WIDTH-M: 14.375rem;
--MENU-WIDTH-L: 18.75rem;
}
</style>
````