You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default `<a>` elements already use the right link color and apply an underline on hover.
10
+
11
+
```html live
12
+
Some text with a default <ahref="#url">link</a>
13
+
```
14
+
15
+
If you need to make other elements behave like a link and perhaps use JS to trigger navigating to another page, use the `.Link` class.
16
+
17
+
```html live
18
+
Some text with a <spanclass="Link">span that behaves like a link</span>
19
+
```
20
+
21
+
If you like to override the default link styles you can do so with the following link utilities. **Bear in mind that link styles are easier for more people to see and interact with when the changes in styles do not rely on color alone.**
22
+
23
+
Use `.Link--primary` to turn the link color to blue only on hover.
24
+
25
+
```html live
26
+
<pclass="color-text-secondary">Some text with a <aclass="Link--primary"href="#url">Link--primary</a></p>
27
+
```
28
+
29
+
Use `.Link--secondary` for a more subtle link color that turns blue on hover.
30
+
31
+
```html live
32
+
Some text with a <aclass="Link--secondary"href="#url">Link--secondary</a>
33
+
```
34
+
35
+
Use `.Link--muted` also removes the underline on hover. Tip: You can also use the `.no-underline` utility to do the same for `.Link--primary`.
36
+
37
+
```html live
38
+
<p>Some text with a <aclass="Link--secondary no-underline"href="#url">Link--muted</a></p>
39
+
<p>Some text with a <aclass="Link--primary no-underline"href="#url">Link--primary no-underline</a></p>
40
+
```
41
+
42
+
Use `.Link--onHover` to make any text color used with links to turn blue on hover. This is useful when you want only part of a link to turn blue on hover.
@@ -156,39 +157,7 @@ On dark backgrounds use `border-white-fade` instead. It adds an rgba white borde
156
157
157
158
## Link colors
158
159
159
-
By default `<a>` elements already use a text color that is blue and apply an underline on hover. If you need to make other elements behave like a link and perhaps use JS to trigger navigating to another page, use the `.link-primary` class.
160
-
161
-
```html live
162
-
<spanclass="link-primary">link-primary</span>
163
-
```
164
-
165
-
If you like to override the default link styles you can do so with text color utilities and the following link utilities. **Bear in mind that link styles are easier for more people to see and interact with when the changes in styles do not rely on color alone.**
166
-
167
-
Use `.link-secondary` to turn the link color to blue only on hover.
Use `.muted-link` for a more subtle color, that turns blue on hover but with **no underline**.
180
-
181
-
```html live
182
-
<aclass="muted-link"href="#url">muted-link</a>
183
-
```
184
-
185
-
Use `.link-hover-blue` to make any text color used with links to turn blue on hover. This is useful when you want only part of a link to turn blue on hover.
Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
11
+
12
+
```scss
13
+
@import"@primer/css/links/index.scss";
14
+
```
15
+
16
+
## Build
17
+
18
+
The `@primer/css` npm package includes a standalone CSS build of this module in `dist/links.css`.
0 commit comments