Skip to content

Commit

Permalink
Fix <sup><a> from getting wrapped with [ ] (#1928)
Browse files Browse the repository at this point in the history
* Scope `[ ]` to data-footnote-ref

* Stylelint auto-fixes

* Create ninety-moles-clap.md

Co-authored-by: Actions Auto Build <[email protected]>
  • Loading branch information
simurai and actions-user authored Feb 3, 2022
1 parent 670149d commit 0fb6789
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 34 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-moles-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": patch
---

Fix `<sup><a>` from getting wrapped with `[ ]`
64 changes: 38 additions & 26 deletions src/markdown/footnotes.scss
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
// stylelint-disable selector-max-type
// stylelint-disable selector-max-compound-selectors

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

ol {
padding-left: $spacer-3;
&::after {
content: ']';
}
}

li {
position: relative;
}
.footnotes {
font-size: $h6-size;
color: var(--color-fg-muted);
border-top: $border;

li:target::before {
position: absolute;
top: -$spacer-2;
right: -$spacer-2;
bottom: -$spacer-2;
left: -$spacer-4;
pointer-events: none;
content: '';
// stylelint-disable-next-line primer/borders
border: 2px $border-style var(--color-accent-emphasis);
border-radius: $border-radius;
}
ol {
padding-left: $spacer-3;
}

li:target {
color: var(--color-fg-default);
}
li {
position: relative;
}

li:target::before {
position: absolute;
top: -$spacer-2;
right: -$spacer-2;
bottom: -$spacer-2;
left: -$spacer-4;
pointer-events: none;
content: '';
// stylelint-disable-next-line primer/borders
border: 2px $border-style var(--color-accent-emphasis);
border-radius: $border-radius;
}

li:target {
color: var(--color-fg-default);
}

.data-footnote-backref g-emoji {
font-family: monospace;
.data-footnote-backref g-emoji {
font-family: monospace;
}
}
}
8 changes: 0 additions & 8 deletions src/markdown/markdown-body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,4 @@
margin-bottom: 0;
}
}

sup > a::before {
content: '[';
}

sup > a::after {
content: ']';
}
}

0 comments on commit 0fb6789

Please sign in to comment.