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"> <span data-view-component="true" class="position-relative"><a id="truncate-link-primer" href="https://github.com" data-view-component="true" class="Link">primer</a> <tool-tip id="tooltip-b2e4bfb4-4dcb-4e5f-8d62-8b08d54e9d4c" for="truncate-link-primer" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">primer</tool-tip></span></li>
<li data-view-component="true" class="Truncate-text Truncate-text--primary"> <span data-view-component="true" class="position-relative"><a id="truncate-link-css" href="https://github.com" data-view-component="true" class="Link">/ css</a> <tool-tip id="tooltip-bda5c8b6-dc17-4c9f-895d-45f5717f267c" for="truncate-link-css" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">/ css</tool-tip></span></li>
<li data-view-component="true" class="Truncate-text"> <span data-view-component="true" class="position-relative"><a id="truncate-link-issues" href="https://github.com" data-view-component="true" class="Link">/ Issues</a> <tool-tip id="tooltip-6ccb2117-7a4f-45ed-8245-d002530c0900" for="truncate-link-issues" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">/ Issues</tool-tip></span></li>
<li data-view-component="true" class="Truncate-text"> <span data-view-component="true" class="position-relative"><a id="truncate-link-number" href="https://github.com" data-view-component="true" class="Link">/ #123</a> <tool-tip id="tooltip-066f90b3-e7f4-4fbb-8212-35cf206ff739" for="truncate-link-number" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">/ #123</tool-tip></span></li>
<li data-view-component="true" class="Truncate-text Truncate-text--primary"> <span data-view-component="true" class="position-relative"><a id="truncate-link-title" href="https://github.com" data-view-component="true" class="Link">Visual bug on primer.style found in lists</a> <tool-tip id="tooltip-57ce3afa-af9b-4513-a423-d1ef10002e16" for="truncate-link-title" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">Visual bug on primer.style found in lists</tool-tip></span></li>
</ol>
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
<%= render(Primer::Beta::Truncate.new(tag: :ol)) do |component| %>
<% component.with_item(tag: :li) do %>
<%= render(Primer::Beta::Link.new(href: "https://github.com", id: "truncate-link-primer")) do |link| %>
<% link.with_tooltip(text: "primer") %>
primer
<% end %>
<% end %>
<% component.with_item(tag: :li, priority: true) do %>
<%= render(Primer::Beta::Link.new(href: "https://github.com", id: "truncate-link-css")) do |link| %>
<% link.with_tooltip(text: "/ css") %>
/ css
<% end %>
<% end %>
<% component.with_item(tag: :li) do %>
<%= render(Primer::Beta::Link.new(href: "https://github.com", id: "truncate-link-issues")) do |link| %>
<% link.with_tooltip(text: "/ Issues") %>
/ Issues
<% end %>
<% end %>
<% component.with_item(tag: :li) do %>
<%= render(Primer::Beta::Link.new(href: "https://github.com", id: "truncate-link-number")) do |link| %>
<% link.with_tooltip(text: "/ #123") %>
/ #123
<% end %>
<% end %>
<% component.with_item(tag: :li, priority: true) do %>
<%= render(Primer::Beta::Link.new(href: "https://github.com", id: "truncate-link-title")) do |link| %>
<% link.with_tooltip(text: "Visual bug on primer.style found in lists") %>
Visual bug on primer.style found in lists
<% end %>
<% end %>
<% 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
/* Truncate */
.Truncate {
display: inline-flex;
min-width: 0;
max-width: 100%;
}
.Truncate > .Truncate-text {
min-width: 1ch;
max-width: fit-content;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
:is(.Truncate > .Truncate-text) + .Truncate-text {
/* stylelint-disable-next-line primer/spacing */
margin-left: var(--control-small-gap);
}
.Truncate-text--primary:is(.Truncate > .Truncate-text) {
flex-basis: 200%;
}
.Truncate-text--expandable:is(.Truncate > .Truncate-text):hover,.Truncate-text--expandable:is(.Truncate > .Truncate-text):focus,.Truncate-text--expandable:is(.Truncate > .Truncate-text):active {
max-width: 100% !important;
flex-shrink: 0;
cursor: pointer;
}