Skip to content

Commit

Permalink
breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsnes committed Sep 26, 2024
1 parent 4595838 commit ec4b94d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
6 changes: 6 additions & 0 deletions packages/css/breadcrumbs.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
--dsc-breadcrumbs-spacing: var(--ds-spacing-2);
--dsc-breadcrumbs-chevron-size: var(--ds-sizing-6);

@composes ds-body-text--md from './baseline/typography.css';

&[data-size='sm'] {
--dsc-breadcrumbs-spacing: var(--ds-spacing-1);
--dsc-breadcrumbs-chevron-size: var(--ds-sizing-5);

@composes ds-body-text--sm from './baseline/typography.css';
}

&[data-size='lg'] {
--dsc-breadcrumbs-spacing: var(--ds-spacing-3);
--dsc-breadcrumbs-chevron-size: var(--ds-sizing-7);

@composes ds-body-text--lg from './baseline/typography.css';
}

& > :is(ol, ul) {
Expand Down
17 changes: 7 additions & 10 deletions packages/react/src/components/Breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import cl from 'clsx/lite';
import { type HTMLAttributes, forwardRef } from 'react';
import { Paragraph } from '../Typography';

export type BreadcrumbsProps = {
/**
Expand All @@ -20,14 +19,12 @@ export const Breadcrumbs = forwardRef<HTMLElement, BreadcrumbsProps>(
{ 'aria-label': ariaLabel = 'Du er her:', className, size, ...rest },
ref,
) => (
<Paragraph asChild size={size}>
<nav
aria-label={ariaLabel}
className={cl('ds-breadcrumbs', className)}
data-size={size}
ref={ref}
{...rest}
/>
</Paragraph>
<nav
aria-label={ariaLabel}
className={cl('ds-breadcrumbs', className)}
data-size={size}
ref={ref}
{...rest}
/>
),
);

0 comments on commit ec4b94d

Please sign in to comment.