-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #618 from danskernesdigitalebibliotek/breadcrumb-d…
…esign Breadcrumb design. DDFFORM-608
- Loading branch information
Showing
4 changed files
with
51 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { IconArrow } from "../Arrows/icon-arrow-ui/ArrowUI"; | ||
|
||
export type BreadcrumbProps = { | ||
text: string; | ||
items: { link?: string; text: string }[]; | ||
}; | ||
export const Breadcrumb = ({ text }: BreadcrumbProps) => { | ||
export const Breadcrumb = ({ items }: BreadcrumbProps) => { | ||
return ( | ||
<div className="breadcrumb"> | ||
<IconArrow size="small" direction="left" hover> | ||
<a href="/" className="arrow__link" aria-label="Arrow link"> | ||
<p className="text-links">{text}</p> | ||
</a> | ||
</IconArrow> | ||
</div> | ||
<nav className="breadcrumb" role="navigation"> | ||
{items.map((item) => { | ||
return item.link ? ( | ||
<a href={item.link}>{item.text}</a> | ||
) : ( | ||
<span>{item.text}</span> | ||
); | ||
})} | ||
</nav> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,38 @@ | ||
.breadcrumb { | ||
.arrow__link { | ||
text-decoration: none; | ||
} | ||
@include layout-container($layout__max-width--large); | ||
|
||
.text-links { | ||
color: $color__text-secondary-gray; | ||
margin-bottom: -4px; | ||
@include typography($typo__links); | ||
} | ||
display: flex; | ||
flex-wrap: wrap; | ||
margin-top: $s-lg; | ||
margin-bottom: $s-lg; | ||
row-gap: $s-sm; | ||
|
||
.arrow__body { | ||
stroke: $color__text-secondary-gray; | ||
> a { | ||
@extend %text-inline-link; | ||
} | ||
} | ||
|
||
// We cannot be sure to be able to put classes directly on the children, | ||
// as they might be atom links. | ||
.breadcrumb > * { | ||
@include typography($typo__body-small); | ||
|
||
position: relative; | ||
display: inline-block; | ||
color: $color__text-secondary-gray; | ||
} | ||
|
||
// Targeting all the items that should have a > prefix. | ||
.breadcrumb > * + * { | ||
$_arrow-size: 20px; | ||
|
||
padding-left: $_arrow-size; | ||
|
||
.arrow__head { | ||
fill: $color__global-grey; | ||
&::before { | ||
position: absolute; | ||
content: ">"; | ||
left: 0; | ||
width: $_arrow-size; | ||
text-align: center; | ||
} | ||
} |