-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add footnote styles #1616
Merged
Merged
Add footnote styles #1616
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
487a827
Add footnote styles
talum 2a7dfdd
Create gold-games-tickle.md
jonrohan f5b14bb
disable lints
jonrohan 42d8ab0
Nest footnotes within markdown-body
talum 71f5a5a
Style footnotes
simurai 4fc4ced
Add footnotes to docs
simurai fb251ff
Lint
simurai f8f51df
Bump right border
talum 0082620
Darken text when targeted
talum ee6c52e
Merge branch 'main' into add-footnotes
simurai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/css": minor | ||
--- | ||
|
||
Adding footnote styles to markdown-body. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// 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; | ||
|
||
ol { | ||
padding-left: $spacer-3; | ||
} | ||
|
||
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
@import "./images.scss"; | ||
@import "./code.scss"; | ||
@import "./blob-csv.scss"; | ||
@import "./footnotes.scss"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,4 +95,12 @@ | |
margin-bottom: 0; | ||
} | ||
} | ||
|
||
sup > a::before { | ||
content: "["; | ||
} | ||
|
||
sup > a::after { | ||
content: "]"; | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a chance that a user would want to add a link inside a
<sup>
and not get it wrapped with[]
? It seems we currently use thedata-footnote-ref
attribute. So if we wanted to scope this a bit more, we might can instead use:Not sure if
data-footnote-ref
will be part of, I think we use a "common mark" library and safe to use? 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm...That's a good question.
Yeah,
data-footnote-ref
is safe to use (I added it to the library 😄 ).I think it's a pretty low chance that a user would want that behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, we can keep it "as is" and in case we hear reports from users, switch to using
[data-footnote-ref]
.