diff options
| Commit | 7240b0303395a997885ba22034669a2d4f9ff94a (patch) | |
|---|---|---|
| Author | 2023-07-10 11:43:56 +0300 | |
| Committer | 2023-07-10 11:43:56 +0300 | |
| Files | e6fc1313429aa2cd66d9f400041f5266dbb6b946 | |
| syndamia.com-7240b0303395a997885ba22034669a2d4f9ff94a.tar syndamia.com-7240b0303395a997885ba22034669a2d4f9ff94a.tar.gz syndamia.com-7240b0303395a997885ba22034669a2d4f9ff94a.zip | ||
| Parent | 5bcc7549e75888c07da6a5a0e35af73992d9213b (diff) | |
[heading-anchor] Reworked heading anchors to use the font character
Added aria-hidden, because icon fonts don't work on screen readers
2 files changed, 3 insertions, 4 deletions
| -rw-r--r-- | awk-edits/Heading-anchors.awk | 2 | ||||
| -rw-r--r-- | src/styles.css | 5 |
diff --git a/awk-edits/Heading-anchors.awk b/awk-edits/Heading-anchors.awk index 34c8104..2877fde 100644 --- a/awk-edits/Heading-anchors.awk +++ b/awk-edits/Heading-anchors.awk @@ -8,5 +8,5 @@ /[ \t]*<h[23456]/ { id = substr($0, index($0, "id=\"") + 4) id = substr(id, 0, index(id, "\"") - 1) - gsub(/$/, ORS "<a class=\"h-anchor\" href=\"#" id "\"><img src=\"/img/link.svg\" alt=\"🔗\" loading=\"lazy\"></a>") + gsub(/$/, ORS "<a class=\"h-anchor\" href=\"#" id "\" aria-hidden=\"true\">\\</a>") } diff --git a/src/styles.css b/src/styles.css index 9aa1a39..6563f8d 100644 --- a/src/styles.css +++ b/src/styles.css @@ -136,7 +136,7 @@ img { .file-icon { min-width: 1.3em; vertical-align: text-bottom; } .borderless, .oldschool-badge, .file-icon { border: none; } - .btn { + .btn, .h-anchor { /* Thanks https://stackoverflow.com/a/4407335/12036073 */ -webkit-touch-callout: none; /* iOS Safari */ -webkit-user-select: none; /* Safari */ @@ -196,8 +196,7 @@ h1, h2, h3, h4, h5, h6 { h2 { margin-top: 2.5em; } h3 { margin-top: 2em; } - .h-anchor { border: none !important; display: inline; } - .h-anchor img { border: none; height: 1.3em; vertical-align: text-bottom; } + .h-anchor { border: none; } .h-anchor img, .icon, .file-icon, .file-wrapper > summary { /* Since link images are made for dark mode, and have a white-ish * foreground, this filter makes them black (when in light mode) |