Skip to content

Commit

Permalink
feat(techdocs): use more of the available space for navigation sidebar (
Browse files Browse the repository at this point in the history
backstage#26819)

Signed-off-by: Thomas Cardonne <[email protected]>
  • Loading branch information
tcardonne authored Oct 2, 2024
1 parent 88d03d8 commit e8b4966
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .changeset/thirty-pianos-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@backstage/plugin-techdocs-module-addons-contrib': patch
'@backstage/plugin-techdocs': patch
---

Use more of the available space for the navigation sidebar.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ const EXPANDABLE_NAVIGATION_LOCAL_STORAGE =
const StyledButton = withStyles({
root: {
position: 'absolute',
left: '220px',
left: '13.7rem', // Sidebar inner width (15.1em) minus the different margins/paddings
top: '19px',
zIndex: 2,
padding: 0,
minWidth: 0,
},
Expand Down
21 changes: 15 additions & 6 deletions plugins/techdocs/src/reader/transformers/styles/rules/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ export default ({ theme, sidebar }: RuleOptions) => `
scrollbar-width: thin;
}
.md-sidebar .md-sidebar__scrollwrap {
width: calc(12.1rem);
width: calc(16rem);
overflow-y: hidden;
}
@supports selector(::-webkit-scrollbar) {
[dir=ltr] .md-sidebar__inner {
padding-right: calc(100% - 15.1rem);
}
}
.md-sidebar--secondary {
right: ${theme.spacing(3)}px;
}
Expand Down Expand Up @@ -202,18 +207,22 @@ export default ({ theme, sidebar }: RuleOptions) => `
height: 100%;
}
.md-sidebar--primary {
width: 12.1rem !important;
width: 16rem !important;
z-index: 200;
left: ${
sidebar.isPinned
? `calc(-12.1rem + ${SIDEBAR_WIDTH})`
: 'calc(-12.1rem + 72px)'
? `calc(-16rem + ${SIDEBAR_WIDTH})`
: 'calc(-16rem + 72px)'
} !important;
}
.md-sidebar--secondary:not([hidden]) {
display: none;
}
[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary {
transform: translateX(16rem);
}
.md-content {
max-width: 100%;
margin-left: 0;
Expand Down Expand Up @@ -241,8 +250,8 @@ export default ({ theme, sidebar }: RuleOptions) => `
@media screen and (max-width: 600px) {
.md-sidebar--primary {
left: -12.1rem !important;
width: 12.1rem;
left: -16rem !important;
width: 16rem;
}
}
Expand Down

0 comments on commit e8b4966

Please sign in to comment.