Skip to content

Commit 0fb6789

Browse files
Fix <sup><a> from getting wrapped with [ ] (#1928)
* Scope `[ ]` to data-footnote-ref * Stylelint auto-fixes * Create ninety-moles-clap.md Co-authored-by: Actions Auto Build <[email protected]>
1 parent 670149d commit 0fb6789

File tree

3 files changed

+43
-34
lines changed

3 files changed

+43
-34
lines changed

.changeset/ninety-moles-clap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": patch
3+
---
4+
5+
Fix `<sup><a>` from getting wrapped with `[ ]`

src/markdown/footnotes.scss

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,49 @@
11
// stylelint-disable selector-max-type
22
// stylelint-disable selector-max-compound-selectors
33

4-
.markdown-body .footnotes {
5-
font-size: $h6-size;
6-
color: var(--color-fg-muted);
7-
border-top: $border;
4+
.markdown-body {
5+
[data-footnote-ref] {
6+
&::before {
7+
content: '[';
8+
}
89

9-
ol {
10-
padding-left: $spacer-3;
10+
&::after {
11+
content: ']';
12+
}
1113
}
1214

13-
li {
14-
position: relative;
15-
}
15+
.footnotes {
16+
font-size: $h6-size;
17+
color: var(--color-fg-muted);
18+
border-top: $border;
1619

17-
li:target::before {
18-
position: absolute;
19-
top: -$spacer-2;
20-
right: -$spacer-2;
21-
bottom: -$spacer-2;
22-
left: -$spacer-4;
23-
pointer-events: none;
24-
content: '';
25-
// stylelint-disable-next-line primer/borders
26-
border: 2px $border-style var(--color-accent-emphasis);
27-
border-radius: $border-radius;
28-
}
20+
ol {
21+
padding-left: $spacer-3;
22+
}
2923

30-
li:target {
31-
color: var(--color-fg-default);
32-
}
24+
li {
25+
position: relative;
26+
}
27+
28+
li:target::before {
29+
position: absolute;
30+
top: -$spacer-2;
31+
right: -$spacer-2;
32+
bottom: -$spacer-2;
33+
left: -$spacer-4;
34+
pointer-events: none;
35+
content: '';
36+
// stylelint-disable-next-line primer/borders
37+
border: 2px $border-style var(--color-accent-emphasis);
38+
border-radius: $border-radius;
39+
}
40+
41+
li:target {
42+
color: var(--color-fg-default);
43+
}
3344

34-
.data-footnote-backref g-emoji {
35-
font-family: monospace;
45+
.data-footnote-backref g-emoji {
46+
font-family: monospace;
47+
}
3648
}
3749
}

src/markdown/markdown-body.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,4 @@
9393
margin-bottom: 0;
9494
}
9595
}
96-
97-
sup > a::before {
98-
content: '[';
99-
}
100-
101-
sup > a::after {
102-
content: ']';
103-
}
10496
}

0 commit comments

Comments
 (0)