diff options
| Commit | 2be7266903fbcdcaf87a97c02905e9fae99e542e (patch) | |
|---|---|---|
| Author | 2023-01-08 16:13:36 +0200 | |
| Committer | 2023-01-08 16:13:36 +0200 | |
| Files | d4a9cc8a5b2bcdacb42e7eb95539726cf363b2e2 | |
| syndamia.com-2be7266903fbcdcaf87a97c02905e9fae99e542e.tar syndamia.com-2be7266903fbcdcaf87a97c02905e9fae99e542e.tar.gz syndamia.com-2be7266903fbcdcaf87a97c02905e9fae99e542e.zip | ||
| Parent | d8077cc9cf338cd01ee9dca0d0990c5ce6b86640 (diff) | |
[styles] Header's anchor now has its own class
3 files changed, 9 insertions, 10 deletions
| -rw-r--r-- | generate-hooks/create-header-anchors.awk | 2 | ||||
| -rw-r--r-- | src/darkmode.css | 2 | ||||
| -rw-r--r-- | src/styles.css | 15 |
diff --git a/generate-hooks/create-header-anchors.awk b/generate-hooks/create-header-anchors.awk index a07c736..f6d2815 100644 --- a/generate-hooks/create-header-anchors.awk +++ b/generate-hooks/create-header-anchors.awk @@ -8,7 +8,7 @@ /[ \t]*<h[23456]/ { id = substr($0, index($0, "id=\"") + 4) id = substr(id, 0, index(id, "\"") - 1) - gsub(/$/, ORS "<a href=\"#" id "\"><img src=\"/img/link-tabler.svg\" alt=\"🔗\" loading=\"lazy\"></a>") + gsub(/$/, ORS "<a class=\"h-anchor\" href=\"#" id "\"><img src=\"/img/link-tabler.svg\" alt=\"🔗\" loading=\"lazy\"></a>") } { diff --git a/src/darkmode.css b/src/darkmode.css index fd995a5..b977289 100644 --- a/src/darkmode.css +++ b/src/darkmode.css @@ -22,7 +22,7 @@ } /* This selects the link images, next to headings */ -h2 + a img, h3 + a img, h4 + a img, h5 + a img, h6 + a img, .icon, .file-icon, .file-wrapper > summary { +.h-anchor img, .icon, .file-icon, .file-wrapper > summary { /* Refer to styles.css on why this is necessary */ filter: none; } diff --git a/src/styles.css b/src/styles.css index cee4c39..942512b 100644 --- a/src/styles.css +++ b/src/styles.css @@ -165,17 +165,16 @@ h1, h2, h3, h4, h5, h6, b { h4 { border-bottom: 2px solid var(--border-color); } h2, h3, h4, h5, h6 { display: inline-block; } /* For link to appear next to heading */ - /* Heading link */ h2 + a, h3 + a, h4 + a, h5 + a, h6 + a { + .h-anchor { border: none !important; display: inline; } - /* Heading link */ h2 + a img, h3 + a img, h4 + a img, h5 + a img, h6 + a img { - border: none; - height: 1.3em; - vertical-align: text-bottom; - } - /* Heading link */ h2 + a img, h3 + a img, h4 + a img, h5 + a img, h6 + a img, - .icon, .file-icon, .file-wrapper > summary { + .h-anchor img { + border: none; + height: 1.3em; + vertical-align: text-bottom; + } + .h-anchor img, .icon, .file-icon, .file-wrapper > summary { /* Since link images are made for dark mode, and have white-ish foreground, * this filter makes them black (when in light mode) */ |