-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs(web, web-react, web-twig): Dealing with text truncate in Breadcrumb
refs #DS-960
- Loading branch information
Showing
3 changed files
with
55 additions
and
9 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,35 +1,56 @@ | ||
# Breadcrumbs | ||
|
||
Shows where the user is within the app hierarchy. | ||
|
||
## Usage | ||
|
||
```html | ||
<nav aria-label="Breadcrumb" class="Breadcrumbs"> | ||
<ol> | ||
<li class="d-none d-tablet-flex"> | ||
<a href="#rootUrl" class="link-primary link-underlined">Root</a> | ||
<svg width="24" height="24"> | ||
<use xlink:href="/icons/svg/sprite.svg#chevron-right" /> | ||
</svg> | ||
</li> | ||
<li class="d-none d-tablet-flex"> | ||
<svg class="Icon" width="24" height="24"> | ||
<a href="#categoryUrl" class="link-primary link-underlined">Category</a> | ||
<svg width="24" height="24"> | ||
<use xlink:href="/icons/svg/sprite.svg#chevron-right" /> | ||
</svg> | ||
<a href="#categoryUrl" class="link-primary link-underlined">Category</a> | ||
</li> | ||
<li class="d-tablet-none"> | ||
<svg class="Icon" width="24" height="24"> | ||
<svg width="24" height="24"> | ||
<use xlink:href="/icons/svg/sprite.svg#chevron-left" /> | ||
</svg> | ||
<a href="#subcategoryUrl" class="link-primary link-underlined">Back</a> | ||
</li> | ||
<li class="d-none d-tablet-flex"> | ||
<svg class="Icon" width="24" height="24"> | ||
<a href="#subcategoryUrl" class="link-primary link-underlined">Subcategory</a> | ||
<svg width="24" height="24"> | ||
<use xlink:href="/icons/svg/sprite.svg#chevron-right" /> | ||
</svg> | ||
<a href="#subcategoryUrl" class="link-primary link-underlined">Subcategory</a> | ||
</li> | ||
<li class="d-none d-tablet-flex"> | ||
<svg class="Icon" width="24" height="24"> | ||
<use xlink:href="/icons/svg/sprite.svg#chevron-right" /> | ||
</svg> | ||
<a href="#currentUrl" aria-current="page" class="link-secondary">Current page</a> | ||
</li> | ||
</ol> | ||
</nav> | ||
``` | ||
|
||
### Dealing with long titles | ||
|
||
When you need to shorten the title of the Breadcrumbs item you can use a helper class `text-truncate` with defined width. | ||
|
||
```html | ||
<!-- … ---> | ||
<li class="d-none d-tablet-flex"> | ||
<a href="#currentUrl" aria-current="page" class="link-secondary text-truncate" style="max-width: 100px;"> | ||
This is a very long title of the current page | ||
</a> | ||
<svg width="24" height="24"> | ||
<use xlink:href="/icons/svg/sprite.svg#chevron-right" /> | ||
</svg> | ||
</li> | ||
<!-- … ---> | ||
``` |