Files
outline/app/components/Sidebar/components/ResizeBorder.ts
T
Tom Moor d57db81c6b feat: Split view (#13044)
Adds the ability to open a second route alongside the current one:

- The secondary route is stored in a `split` query string parameter so
  that reloading the page hydrates both panes.
- The secondary pane runs in its own in-memory router kept in sync with
  the query parameter, so links followed inside the pane navigate the
  pane rather than the primary route.
- Navigation while a split is open preserves the split, is directed to
  the focused pane, and routes that cannot render in a pane (such as
  settings) close the split.
- The focused pane is shown with an accent outline, updated as panes are
  clicked or focused, and keyboard shortcuts only apply to the focused
  pane.
- "Open in split view" added to document and collection menus and the
  command bar.
2026-07-19 11:57:33 -04:00

41 lines
962 B
TypeScript

import styled, { css } from "styled-components";
import { s } from "@shared/styles";
import { undraggableOnDesktop } from "~/styles";
const ResizeBorder = styled.div<{
dir?: "left" | "right";
/** When true, the border does not highlight on hover. */
$transparent?: boolean;
}>`
position: absolute;
top: 0;
bottom: 0;
inset-inline-end: ${(props) => (props.dir !== "right" ? "-1px" : "auto")};
inset-inline-start: ${(props) => (props.dir === "right" ? "-1px" : "auto")};
width: 2px;
cursor: col-resize;
${undraggableOnDesktop()}
${(props) =>
!props.$transparent &&
css`
&:hover {
transition-delay: 500ms;
transition: background 250ms ease-in-out;
background: ${s("sidebarActiveBackground")};
}
`}
&:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
inset-inline-end: -4px;
width: 10px;
${undraggableOnDesktop()}
}
`;
export default ResizeBorder;