Skip to content

Commit

Permalink
Make sure truncate is a direct child (#1483)
Browse files Browse the repository at this point in the history
* Make sure truncate is a direct child

* Create clean-wolves-type.md
  • Loading branch information
jonrohan committed Jul 1, 2021
1 parent 1380e88 commit 8448839
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/clean-wolves-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": patch
---

Make sure truncate is a direct child
18 changes: 9 additions & 9 deletions docs/content/components/truncate.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ When text reaches lengths larger than existing container, shorten with ellipses.

## Truncate

Adding the `.Truncate` class and wrapping the inner text with `.Truncate-text` will truncate the text.
Adding the `.Truncate` class and wrapping the inner text with `.Truncate-text` will truncate the text. `.Truncate-text` must be a direct decendent of `.Truncate`.

```html live
<div class="Box p-2" style="resize: horizontal;overflow: scroll;">
Expand Down Expand Up @@ -39,15 +39,15 @@ You can add multiple `.Truncate-text` items in the same row and they will trunca

```html live
<div class="Box p-2" style="resize: horizontal;overflow: scroll;">
<span class="Truncate">
<span class="Truncate-text">primer</span>
<span class="Truncate-text Truncate-text--primary">/ css</span>
<span class="Truncate-text">/ Issues</span>
<span class="Truncate-text">/ #123 —</span>
<span class="Truncate-text Truncate-text--primary">
<ol class="Truncate">
<li class="Truncate-text">primer</li>
<li class="Truncate-text Truncate-text--primary">/ css</li>
<li class="Truncate-text">/ Issues</li>
<li class="Truncate-text">/ #123 —</li>
<li class="Truncate-text Truncate-text--primary">
Visual bug on primer.style found in lists
</span>
</span>
</li>
</ol>
</div>
```

Expand Down
2 changes: 1 addition & 1 deletion src/truncate/truncate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
min-width: 0;
max-width: 100%;

.Truncate-text {
> .Truncate-text {
min-width: 1ch;
max-width: fit-content;
overflow: hidden;
Expand Down

0 comments on commit 8448839

Please sign in to comment.