Skip to content

Commit

Permalink
fix(layout-v6): correct EdgeSidebarContent height for temporary
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Aug 13, 2024
1 parent e413748 commit cdd2343
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
16 changes: 10 additions & 6 deletions blocks/layout-core-v6/EdgeSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ function applyTemporaryStyles(params: Omit<TemporaryConfig, "variant">) {
{
"--EdgeSidebar-temporaryWidth": width,
},
...(fullHeight && {
zIndex: 5,
[`& .${layoutClasses.EdgeSidebarContent}`]: {
top: 0,
},
}),
...(fullHeight
? {
zIndex: 5,
[`& .${layoutClasses.EdgeSidebarContent}`]: {
top: 0,
},
}
: {
"--SidebarContent-offset": "var(--Header-height)",
}),
};
}

Expand Down
2 changes: 1 addition & 1 deletion blocks/layout-core-v6/EdgeSidebarContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const StyledEdgeSidebarContent = styled("div")(({ theme }) => ({
zIndex: 2,
width:
"var(--_temporary, var(--EdgeSidebar-temporaryWidth)) var(--_permanent, calc(var(--SidebarContent-width) - var(--EdgeSidebar-sidelineWidth, 0px)))",
height: "var(--_temporary, 100%)",
height: "var(--_temporary, calc(100% - var(--SidebarContent-offset, 0px)))",
overflowY: "var(--_temporary, auto)" as any,
transition: `var(--_temporary, opacity 0.3s, transform 0.3s)
var(--_permanent, opacity 0.4s, width 0.3s var(--SidebarContent-transitionDelay, 0s), transform 0.3s var(--SidebarContent-transitionDelay, 0s), box-shadow 0.3s var(--SidebarContent-transitionDelay, 0s))`,
Expand Down
16 changes: 10 additions & 6 deletions blocks/layout-core-v6/EdgeSidebarRight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ export function applyTemporaryRightStyles(
{
"--EdgeSidebar-temporaryWidth": width,
},
...(fullHeight && {
zIndex: 5,
[`& .${layoutClasses.EdgeSidebarContent}`]: {
top: 0,
},
}),
...(fullHeight
? {
zIndex: 5,
[`& .${layoutClasses.EdgeSidebarContent}`]: {
top: 0,
},
}
: {
"--SidebarContent-offset": "var(--Header-height)",
}),
};
}

Expand Down

0 comments on commit cdd2343

Please sign in to comment.