Previews

No matching results.

x
1
2
3
4
5
6
7
<ol data-view-component="true" class="Truncate">
<li data-view-component="true" class="Truncate-text">primer</li>
<li data-view-component="true" class="Truncate-text Truncate-text--primary">/ css</li>
<li data-view-component="true" class="Truncate-text">/ Issues</li>
<li data-view-component="true" class="Truncate-text">/ #123</li>
<li data-view-component="true" class="Truncate-text Truncate-text--primary">Visual bug on primer.style found in lists</li>
</ol>
1
2
3
4
5
6
7
render(Primer::Beta::Truncate.new(tag: :ol)) do |component|
component.with_item(tag: :li) { "primer" }
component.with_item(tag: :li, priority: true) { "/ css" }
component.with_item(tag: :li) { "/ Issues" }
component.with_item(tag: :li) { "/ #123" }
component.with_item(tag: :li, priority: true) { "Visual bug on primer.style found in lists" }
end

app/components/primer/beta/truncate.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Truncate */
.Truncate {
display: inline-flex;
min-width: 0;
max-width: 100%;
}
.Truncate > .Truncate-text {
min-width: 1ch;
max-width: -moz-fit-content;
max-width: fit-content;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.Truncate > .Truncate-text + .Truncate-text {
margin-left: var(--control-small-gap);
}
.Truncate > .Truncate-text.Truncate-text--primary {
flex-basis: 200%;
}
.Truncate > .Truncate-text.Truncate-text--expandable:hover,
.Truncate > .Truncate-text.Truncate-text--expandable:focus,
.Truncate > .Truncate-text.Truncate-text--expandable:active {
max-width: 100% !important;
flex-shrink: 0;
cursor: pointer;
}