diff --git a/app/components/Breadcrumb.tsx b/app/components/Breadcrumb.tsx
index a7e4c6369c..7a9296ddd3 100644
--- a/app/components/Breadcrumb.tsx
+++ b/app/components/Breadcrumb.tsx
@@ -73,17 +73,14 @@ function Breadcrumb(
const item = actionToMenuItem(action, actionContext) as MenuInternalLink;
return (
- <>
+ -
{item.icon}
-
-
- {item.title}
-
- >
+ {item.title}
+
);
},
[actionContext, handleClick, highlightFirstItem]
@@ -109,24 +106,39 @@ const Slash = styled(GoToIcon)`
fill: ${s("divider")};
`;
-const Item = styled(Link)<{ $highlight: boolean; $withIcon: boolean }>`
- ${ellipsis()}
+const Item = styled(Link)<{ $highlight: boolean }>`
${undraggableOnDesktop()}
+ display: flex;
+ align-items: center;
+ gap: 4px;
flex-shrink: 1;
min-width: 0;
cursor: var(--pointer);
color: ${s("text")};
font-size: 15px;
- height: 24px;
- line-height: 24px;
+ height: 32px;
font-weight: ${(props) => (props.$highlight ? "500" : "inherit")};
- margin-inline-start: ${(props) => (props.$withIcon ? "4px" : "0")};
- max-width: 460px;
+ padding-inline: 8px;
+ border-radius: 4px;
+ margin-inline: -4px;
- &:hover {
- text-decoration: underline;
+ &:first-child {
+ margin-inline-start: 0;
+ }
+ max-width: 460px;
+ transition: background 100ms ease-in-out;
+
+ &:hover,
+ &:has([data-state="open"]) {
+ background: ${s("buttonNeutralHoverBackground")};
+ transition: none;
}
`;
+const Title = styled.span`
+ ${ellipsis()}
+ min-width: 0;
+`;
+
export default observer(React.forwardRef(Breadcrumb));
diff --git a/app/components/Button.tsx b/app/components/Button.tsx
index 50d0cdd5a6..00bd4e725a 100644
--- a/app/components/Button.tsx
+++ b/app/components/Button.tsx
@@ -76,7 +76,7 @@ const RealButton = styled(ActionButton)`
background: ${
props.$borderOnHover
? props.theme.buttonNeutralBackground
- : darken(0.05, props.theme.buttonNeutralBackground)
+ : props.theme.buttonNeutralHoverBackground
};
box-shadow: rgba(0, 0, 0, 0.07) 0px 1px 2px, ${
props.theme.buttonNeutralBorder
diff --git a/app/components/DocumentBreadcrumb.tsx b/app/components/DocumentBreadcrumb.tsx
index aa53d86efc..f93751ffc0 100644
--- a/app/components/DocumentBreadcrumb.tsx
+++ b/app/components/DocumentBreadcrumb.tsx
@@ -5,6 +5,7 @@ import * as React from "react";
import { useTranslation } from "react-i18next";
import styled from "styled-components";
import Icon from "@shared/components/Icon";
+import { ellipsis } from "@shared/styles";
import type Collection from "~/models/Collection";
import type Document from "~/models/Document";
import Breadcrumb from "~/components/Breadcrumb";
@@ -124,12 +125,12 @@ function DocumentBreadcrumb(
}),
createInternalLinkAction({
name: collection ? (
-
+ }
+ />
) : undefined,
section: ActiveDocumentSection,
- icon: collection ? (
-
- ) : undefined,
visible: !!(collection && can.readDocument),
to: collection
? {
@@ -152,15 +153,17 @@ function DocumentBreadcrumb(
documentId={node.id}
collection={collection}
title={title}
+ icon={
+ node.icon ? (
+
+ ) : undefined
+ }
/>
),
- icon: node.icon ? (
-
- ) : undefined,
section: ActiveDocumentSection,
to: {
pathname: node.url,
@@ -231,11 +234,13 @@ function DocumentBreadcrumb(
);
}
-/** Renders a collection name wrapped in a context menu. */
+/** Renders a collection name and icon wrapped in a context menu. */
const CollectionName = observer(function CollectionName_({
collection,
+ icon,
}: {
collection: Collection;
+ icon?: React.ReactNode;
}) {
const { t } = useTranslation();
const menuAction = useCollectionMenuAction({
@@ -245,21 +250,26 @@ const CollectionName = observer(function CollectionName_({
return (
- {collection.name}
+
+ {icon}
+ {collection.name}
+
);
});
-/** Renders a document name wrapped in a context menu. */
+/** Renders a document name and icon wrapped in a context menu. */
const DocumentName = observer(function DocumentName_({
documentId,
collection,
title,
+ icon,
}: {
documentId: string;
collection: Collection | undefined;
title: string;
+ icon?: React.ReactNode;
}) {
const { t } = useTranslation();
const { documents } = useStores();
@@ -267,7 +277,12 @@ const DocumentName = observer(function DocumentName_({
const menuAction = useDocumentMenuAction({ documentId });
if (!doc) {
- return <>{title}>;
+ return (
+
+ {icon}
+ {title}
+
+ );
}
return (
@@ -277,12 +292,28 @@ const DocumentName = observer(function DocumentName_({
}}
>
- {title}
+
+ {icon}
+ {title}
+
);
});
+const Name = styled.span`
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ min-width: 0;
+ max-width: 100%;
+`;
+
+const NameText = styled.span`
+ ${ellipsis()}
+ min-width: 0;
+`;
+
const SmallSlash = styled(GoToIcon)`
width: 12px;
height: 12px;
diff --git a/app/components/Sharing/components/index.tsx b/app/components/Sharing/components/index.tsx
index c1c0c9f537..74a96f9e68 100644
--- a/app/components/Sharing/components/index.tsx
+++ b/app/components/Sharing/components/index.tsx
@@ -1,4 +1,3 @@
-import { darken } from "polished";
import styled from "styled-components";
import Flex from "@shared/components/Flex";
import { s, hover } from "@shared/styles";
@@ -13,7 +12,7 @@ export { GroupMembersPopover } from "./GroupMembersPopover";
export const Wrapper = styled.div`
${NudeButton}:${hover},
${NudeButton}[aria-expanded="true"] {
- background: ${(props) => darken(0.05, props.theme.buttonNeutralBackground)};
+ background: ${s("buttonNeutralHoverBackground")};
}
`;
diff --git a/app/components/Sidebar/components/SidebarButton.tsx b/app/components/Sidebar/components/SidebarButton.tsx
index 1b2a43fe1c..0577521c88 100644
--- a/app/components/Sidebar/components/SidebarButton.tsx
+++ b/app/components/Sidebar/components/SidebarButton.tsx
@@ -103,6 +103,7 @@ const Button = styled(Flex)<{
text-align: start;
user-select: none;
position: relative;
+ cursor: var(--pointer);
${undraggableOnDesktop()}
${extraArea(4)}
@@ -119,7 +120,6 @@ const Button = styled(Flex)<{
&[aria-expanded="true"] {
color: ${s("sidebarText")};
background: ${s("sidebarActiveBackground")};
- cursor: var(--pointer);
}
}
`;
diff --git a/app/components/Sidebar/components/SidebarLink.tsx b/app/components/Sidebar/components/SidebarLink.tsx
index 2381c57c27..1f5b96d44c 100644
--- a/app/components/Sidebar/components/SidebarLink.tsx
+++ b/app/components/Sidebar/components/SidebarLink.tsx
@@ -295,7 +295,6 @@ const Link = styled(NavLink)<{
min-height: 30px;
user-select: none;
white-space: nowrap;
- margin-top: 1px;
background: var(--background);
color: ${(props) =>
props.$isActiveDrop ? props.theme.white : props.theme.sidebarText};
@@ -331,7 +330,8 @@ const Link = styled(NavLink)<{
transition: fill 50ms;
}
- &: ${hover} {
+ &: ${hover},
+ &:has([data-state="open"]) {
${HiddenDisclosure} {
display: block;
}
@@ -349,7 +349,9 @@ const Link = styled(NavLink)<{
`}
@media (hover: hover) {
- &:hover ${Actions}, &:active ${Actions} {
+ &:hover ${Actions},
+ &:active ${Actions},
+ &:has([data-state="open"]) ${Actions} {
visibility: visible;
svg {
@@ -357,7 +359,8 @@ const Link = styled(NavLink)<{
}
}
- &:hover {
+ &:hover,
+ &:has([data-state="open"]) {
color: ${(props) =>
props.$isActiveDrop ? props.theme.white : props.theme.text};
}
diff --git a/app/components/primitives/SplitButton.tsx b/app/components/primitives/SplitButton.tsx
index e515f4fbca..6e912ce146 100644
--- a/app/components/primitives/SplitButton.tsx
+++ b/app/components/primitives/SplitButton.tsx
@@ -1,6 +1,6 @@
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
import { CheckmarkIcon, ExpandedIcon } from "outline-icons";
-import { darken, transparentize } from "polished";
+import { transparentize } from "polished";
import * as React from "react";
import styled, { css } from "styled-components";
import { s } from "@shared/styles";
@@ -185,7 +185,7 @@ const MainButton = styled.button<{ $neutral?: boolean }>`
&:hover:not(:disabled) {
background: ${(props) =>
props.$neutral
- ? darken(0.05, props.theme.buttonNeutralBackground)
+ ? props.theme.buttonNeutralHoverBackground
: "rgba(0, 0, 0, 0.1)"};
transition: background 0s;
}
@@ -204,7 +204,7 @@ const DisclosureButton = styled.button<{ $neutral?: boolean }>`
&[data-state="open"] {
background: ${(props) =>
props.$neutral
- ? darken(0.05, props.theme.buttonNeutralBackground)
+ ? props.theme.buttonNeutralHoverBackground
: "rgba(0, 0, 0, 0.1)"};
transition: background 0s;
}
diff --git a/app/menus/BreadcrumbMenu.tsx b/app/menus/BreadcrumbMenu.tsx
index d6e0cced58..a3821ce1b9 100644
--- a/app/menus/BreadcrumbMenu.tsx
+++ b/app/menus/BreadcrumbMenu.tsx
@@ -1,4 +1,6 @@
import { useTranslation } from "react-i18next";
+import styled from "styled-components";
+import { s } from "@shared/styles";
import { DropdownMenu } from "~/components/Menu/DropdownMenu";
import { OverflowMenuButton } from "~/components/Menu/OverflowMenuButton";
import { useMenuAction } from "~/hooks/useMenuAction";
@@ -15,7 +17,26 @@ export default function BreadcrumbMenu({ actions }: Props) {
return (
-
+
);
}
+
+const Button = styled(OverflowMenuButton)`
+ && {
+ width: 32px;
+ height: 32px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 4px;
+ margin-inline: -4px;
+ transition: background 100ms ease-in-out;
+ }
+
+ &&:hover,
+ &&[data-state="open"] {
+ background: ${s("buttonNeutralHoverBackground")};
+ transition: none;
+ }
+`;
diff --git a/app/scenes/Document/components/Header.tsx b/app/scenes/Document/components/Header.tsx
index 1be8364126..3a71809482 100644
--- a/app/scenes/Document/components/Header.tsx
+++ b/app/scenes/Document/components/Header.tsx
@@ -6,6 +6,7 @@ import { Link } from "react-router-dom";
import useMeasure from "react-use-measure";
import styled, { useTheme } from "styled-components";
import Icon from "@shared/components/Icon";
+import { s } from "@shared/styles";
import { altDisplay, metaDisplay } from "@shared/utils/keyboard";
import { publishDocument } from "~/actions/definitions/documents";
import { restoreRevision } from "~/actions/definitions/revisions";
@@ -130,7 +131,7 @@ function DocumentHeader({
shortcut={`Ctrl+${altDisplay}+h`}
placement="bottom"
>
- }
@@ -182,7 +183,10 @@ function DocumentHeader({
) : (
- {toc}
+ {toc}{" "}
+
+
+
)
}
@@ -311,4 +315,34 @@ const StyledHeader = styled(Header)<{ $hidden: boolean }>`
${(props) => props.$hidden && "opacity: 0;"}
`;
+const TocButton = styled(Button)`
+ border-radius: 4px;
+
+ &&:hover:not(:disabled),
+ &&[aria-expanded="true"] {
+ background: ${s("buttonNeutralHoverBackground")};
+ box-shadow: none;
+ transition: none;
+ }
+`;
+
+const StarAction = styled.span`
+ display: inline-flex;
+
+ button {
+ width: 32px;
+ height: 32px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 4px;
+ transition: background 100ms ease-in-out;
+
+ &:hover {
+ background: ${s("buttonNeutralHoverBackground")};
+ transition: none;
+ }
+ }
+`;
+
export default observer(DocumentHeader);
diff --git a/app/typings/styled-components.d.ts b/app/typings/styled-components.d.ts
index d844c40551..4f893b87bb 100644
--- a/app/typings/styled-components.d.ts
+++ b/app/typings/styled-components.d.ts
@@ -166,6 +166,7 @@ declare module "styled-components" {
mentionBackground: string;
mentionHoverBackground: string;
buttonNeutralBackground: string;
+ buttonNeutralHoverBackground: string;
buttonNeutralText: string;
buttonNeutralBorder: string;
tooltipBackground: string;
diff --git a/shared/styles/theme.ts b/shared/styles/theme.ts
index 8e600ec2e1..ce165ab789 100644
--- a/shared/styles/theme.ts
+++ b/shared/styles/theme.ts
@@ -26,7 +26,7 @@ const defaultColors: Colors = {
black75: "rgba(0, 0, 0, 0.75)",
accent: "#0366d6",
yellow: "#EDBA07",
- warmGrey: "#EDF2F7",
+ warmGrey: "hsl(212 31% 95% / 1)",
danger: "#ed2651",
warning: "#f08a24",
success: "#3ad984",
@@ -130,7 +130,7 @@ export const buildLightTheme = (input: Partial): DefaultTheme => {
textDiffDeleted: colors.slateDark,
textDiffDeletedBackground: "rgba(255, 180, 173, 0.25)",
placeholder: "#a2b2c3",
- sidebarBackground: colors.warmGrey,
+ sidebarBackground: "hsl(212 31% 95% / 1)",
sidebarHoverBackground: "hsl(212 31% 90% / 1)",
sidebarActiveBackground: "hsl(212 31% 85% / 1)",
sidebarControlHoverBackground: "rgb(138 164 193 / 20%)",
@@ -158,8 +158,9 @@ export const buildLightTheme = (input: Partial): DefaultTheme => {
mentionHoverBackground: "#d7e0ea",
tableSelected: colors.accent,
buttonNeutralBackground: colors.white,
+ buttonNeutralHoverBackground: colors.warmGrey,
buttonNeutralText: colors.almostBlack,
- buttonNeutralBorder: darken(0.15, colors.white),
+ buttonNeutralBorder: "hsl(212 31% 88% / 1)",
tooltipBackground: colors.almostBlack,
tooltipText: colors.white,
toastBackground: colors.white,
@@ -194,7 +195,7 @@ export const buildDarkTheme = (input: Partial): DefaultTheme => {
textDiffInsertedBackground: "rgba(63,185,80,0.25)",
textDiffDeleted: darken(0.1, colors.almostWhite),
textDiffDeletedBackground: "rgba(248,81,73,0.15)",
- placeholder: "#596673",
+ placeholder: "hsl(215 17% 30% / 1)",
sidebarBackground: colors.veryDarkBlue,
sidebarHoverBackground: lighten(0.05, colors.veryDarkBlue),
sidebarActiveBackground: lighten(0.09, colors.veryDarkBlue),
@@ -223,6 +224,7 @@ export const buildDarkTheme = (input: Partial): DefaultTheme => {
mentionHoverBackground: lighten(0.15, colors.veryDarkBlue),
tableSelected: colors.accent,
buttonNeutralBackground: colors.almostBlack,
+ buttonNeutralHoverBackground: lighten(0.09, colors.veryDarkBlue),
buttonNeutralText: colors.white,
buttonNeutralBorder: colors.slateDark,
tooltipBackground: colors.white,