diff options
| author | tdro <tdro@noreply.example.com> | 2022-05-31 00:48:35 -0400 |
|---|---|---|
| committer | tdro <tdro@noreply.example.com> | 2022-05-31 00:48:35 -0400 |
| commit | 033a5bf2d11ee7052967f1148f495d9c0cc14662 (patch) | |
| tree | 45fe9724e105641233139036c7ed02474d05c757 | |
| parent | a7ae254e947d74dac5d3cbb28469f89ac0947ad8 (diff) | |
| download | canory-033a5bf2d11ee7052967f1148f495d9c0cc14662.tar.gz canory-033a5bf2d11ee7052967f1148f495d9c0cc14662.tar.bz2 canory-033a5bf2d11ee7052967f1148f495d9c0cc14662.zip | |
themes/default/layouts/shortcodes/abbr: Allow click expansion
| -rw-r--r-- | assets/css/default.css | 12 | ||||
| -rw-r--r-- | themes/default/layouts/shortcodes/abbr.html | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/assets/css/default.css b/assets/css/default.css index 046f3d1..18b1c22 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -351,7 +351,6 @@ item-list a span:first-child { } abbr[title] { - cursor: help; border-bottom: 1px dashed; text-decoration: none; } @@ -360,6 +359,10 @@ abbr[title]:hover { border-bottom: 2px dashed; } +[type="checkbox"]:checked ~ abbr[title]::after { + content: " (" attr(title) ")"; +} + samp { font-variant: all-small-caps; letter-spacing: 0.05rem; @@ -730,6 +733,9 @@ micro-metadata unlisted-entry { font-variant: all-small-caps; } +s label, +abbr[title], +abbr[title] label, micro-metadata read-time, micro-metadata word-limit, micro-metadata expiry-date, @@ -1474,10 +1480,6 @@ s { color: transparent; } -s label { - cursor: help; -} - [type="checkbox"]:checked ~ s { background-color: inherit; color: inherit; diff --git a/themes/default/layouts/shortcodes/abbr.html b/themes/default/layouts/shortcodes/abbr.html index e40df57..0edff43 100644 --- a/themes/default/layouts/shortcodes/abbr.html +++ b/themes/default/layouts/shortcodes/abbr.html @@ -1,5 +1,7 @@ {{- $abbr := default "TL;DR:" (.Get "abbr" | default (.Get 0)) -}} {{- $title := default "Too long, didn't read" (.Get "title" | default (.Get 1)) -}} -<abbr title="{{ $title }}">{{ $abbr | markdownify }}</abbr> +{{- $id := delimit (shuffle (seq 0 20)) "" -}} +<input hidden type="checkbox" id="abbr-{{ $id }}" /> +<abbr title="{{ $title }}"><label for="abbr-{{ $id }}">{{ $abbr | markdownify }}</label></abbr> {{- /* This comment removes trailing newlines and white spaces. */ -}} |
