Skip to content

Commit

Permalink
fix(docusaurus): sidebar enhancements (#963)
Browse files Browse the repository at this point in the history
* Fix Dialog component

* Add changeset for Dialog

* Keep Docusaurus sidebar link color

* Don't overflow sidebar

---------

Co-authored-by: sushitommy <>
  • Loading branch information
sushitommy authored Dec 16, 2024
1 parent 2854c96 commit 103e6af
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .changeset/spotty-pumas-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@nl-rvo/css-dialog": patch
"@nl-rvo/component-library-css": patch
"@nl-rvo/component-library-react": patch
---

Fixed Dialog border and margin
3 changes: 3 additions & 0 deletions components/dialog/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Dialog
.rvo-dialog {
border: none;
box-sizing: border-box;
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -30,6 +31,7 @@
.rvo-dialog--drawer-left {
height: 100vh;
left: 0;
margin: initial;
max-width: var(--rvo-dialog-drawer-max-width);
min-width: var(--rvo-dialog-drawer-min-width);
position: fixed;
Expand All @@ -40,6 +42,7 @@

.rvo-dialog--drawer-right {
height: 100vh;
margin: initial;
max-width: var(--rvo-dialog-drawer-max-width);
min-width: var(--rvo-dialog-drawer-min-width);
position: fixed;
Expand Down
1 change: 1 addition & 0 deletions components/max-width-layout/src/defaultArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export const defaultArgs: IMaxWidthLayoutProps = {
content: 'Deze gecentreerde layout container heeft een maximale breedte van {maxWidth}.',
centered: true,
inlinePadding: 'none',
useAsMinWidthToo: true,
};
13 changes: 11 additions & 2 deletions components/max-width-layout/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,25 @@

.rvo-max-width-layout--sm {
max-width: var(--rvo-layout-max-width-sm);
min-width: var(--rvo-layout-max-width-sm);
}

.rvo-max-width-layout--md {
max-width: var(--rvo-layout-max-width-md);
min-width: var(--rvo-layout-max-width-md);
}

.rvo-max-width-layout--lg {
max-width: var(--rvo-layout-max-width-lg);
}

.rvo-min-width-layout--sm {
min-width: var(--rvo-layout-max-width-sm);
}

.rvo-min-width-layout--md {
min-width: var(--rvo-layout-max-width-md);
}

.rvo-min-width-layout--lg {
min-width: var(--rvo-layout-max-width-lg);
}

Expand Down
6 changes: 6 additions & 0 deletions components/max-width-layout/src/template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface IMaxWidthLayoutProps {
content?: string;
inlinePadding?: 'none' | 'sm' | 'md' | 'lg';
centered?: boolean;
useAsMinWidthToo?: boolean;
/** @uxpinignoreprop */
className?: string | string[];
/** @uxpinpropname Content */
Expand All @@ -29,6 +30,9 @@ export const argTypes = {
content: {
control: 'text',
},
useAsMinWidthToo: {
control: 'boolean',
},
centered: {
control: 'boolean',
},
Expand All @@ -48,6 +52,7 @@ export const MaxWidthLayout: React.FC<IMaxWidthLayoutProps> = ({
content = defaultArgs.content,
inlinePadding = defaultArgs.inlinePadding,
centered = defaultArgs.centered,
useAsMinWidthToo = defaultArgs.useAsMinWidthToo,
children,
className = [],
...props
Expand Down Expand Up @@ -75,6 +80,7 @@ export const MaxWidthLayout: React.FC<IMaxWidthLayoutProps> = ({
className={clsx(
'rvo-max-width-layout',
`rvo-max-width-layout--${size}`,
useAsMinWidthToo && `rvo-min-width-layout--${size}`,
`rvo-max-width-layout-inline-padding--${inlinePadding}`,
!centered && 'rvo-max-width-layout--uncentered',
className,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,4 @@
cursor: pointer;
width: var(--doc-sidebar-hidden-width);
}

.sidebarViewport {
top: var(--ifm-navbar-height);
position: sticky;
height: 100%;
max-height: calc(100vh - 137px);
}
}
2 changes: 2 additions & 0 deletions packages/docusaurus/src/theme/DocSidebarItem/Link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
import { Link } from '@nl-rvo/components';
import type { Props } from '@theme/DocSidebarItem/Link';
import clsx from 'clsx';
import styles from './styles.module.css';

export default function DocSidebarItemLink({ item, onItemClick, activePath, level, ...props }: Props): JSX.Element {
const { href, label, className } = item;
Expand Down Expand Up @@ -32,6 +33,7 @@ export default function DocSidebarItemLink({ item, onItemClick, activePath, leve
{...props}
showIcon={!isInternalLink ? 'after' : 'no'}
icon={!isInternalLink ? 'externe-link' : undefined}
className={styles['sidebar-link']}
>
{label}
</Link>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.sidebar-link:hover,
.sidebar-link:focus {
color: var(--rvo-color-grijs-700) !important;
}

0 comments on commit 103e6af

Please sign in to comment.