Previews

No matching results.

x
1
<span data-view-component="true" class="position-relative"><a id="tooltip-link" href="#" data-view-component="true" class="Link Link--underline">Link with tooltip</a><tool-tip id="tooltip-7b21fd93-7af5-4294-8498-ac4170678533" for="tooltip-link" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">Tooltip text</tool-tip></span>
1
2
3
4
render(Primer::Beta::Link.new(href: "#", id: "tooltip-link", scheme: scheme, muted: muted, underline: underline)) do |component|
component.with_tooltip(text: "Tooltip text")
"Link with tooltip"
end

app/components/primer/beta/link.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* Links */
.Link {
color: var(--fgColor-accent);
-webkit-text-decoration: none;
text-decoration: none;
}
.Link:hover {
-webkit-text-decoration: underline;
text-decoration: underline;
cursor: pointer;
}
.Link:focus {
-webkit-text-decoration: underline;
text-decoration: underline;
}
.Link:focus,.Link:focus-visible {
outline-offset: 0;
}
.Link--underline {
-webkit-text-decoration: underline;
text-decoration: underline;
}
.Link--primary {
color: var(--fgColor-default) !important;
}
.Link--primary:hover {
color: var(--fgColor-accent) !important;
}
.Link--secondary {
color: var(--fgColor-muted) !important;
}
.Link--secondary:hover {
color: var(--fgColor-accent) !important;
}
.Link--muted {
color: var(--fgColor-muted) !important;
}
.Link--muted:hover {
color: var(--fgColor-accent) !important;
-webkit-text-decoration: none;
text-decoration: none;
}
/* Set the link color only on hover
Useful when you want only part of a link to turn blue on hover */
.Link--onHover:hover {
color: var(--fgColor-accent) !important;
-webkit-text-decoration: underline;
text-decoration: underline;
cursor: pointer;
}
/* When using a color utility class inside of a link class
color should change with link on hover. */
:is(.Link--secondary,.Link--primary,.Link--muted):hover [class*='color-fg'] {
color: inherit !important;
}