Previews

No matching results.

x
1
2
3
4
<a href="#" data-view-component="true" class="Link"><span data-view-component="true" class="Link-content"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-mark-github">
<path d="M6.766 11.328c-2.063-.25-3.516-1.734-3.516-3.656 0-.781.281-1.625.75-2.188-.203-.515-.172-1.609.063-2.062.625-.078 1.468.25 1.968.703.594-.187 1.219-.281 1.985-.281.765 0 1.39.094 1.953.265.484-.437 1.344-.765 1.969-.687.218.422.25 1.515.046 2.047.5.593.766 1.39.766 2.203 0 1.922-1.453 3.375-3.547 3.64.531.344.89 1.094.89 1.954v1.625c0 .468.391.734.86.547C13.781 14.359 16 11.53 16 8.03 16 3.61 12.406 0 7.984 0 3.563 0 0 3.61 0 8.031a7.88 7.88 0 0 0 5.172 7.422c.422.156.828-.125.828-.547v-1.25c-.219.094-.5.156-.75.156-1.031 0-1.64-.562-2.078-1.609-.172-.422-.36-.672-.719-.719-.187-.015-.25-.093-.25-.187 0-.188.313-.328.625-.328.453 0 .844.281 1.25.86.313.452.64.655 1.031.655s.641-.14 1-.5c.266-.265.47-.5.657-.656"></path>
</svg>
Link with leading icon</span></a>
1
2
3
4
render(Primer::Beta::Link.new(href: "#")) do |component|
component.with_leading_visual_icon(icon: :"mark-github")
"Link with leading icon"
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
71
72
73
74
75
76
77
78
79
/* 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;
}
.Link-content {
display: inline-flex;
align-items: center;
/* stylelint-disable-next-line primer/typography */
line-height: normal;
gap: var(--base-size-4);
text-decoration: inherit;
}