From 0bfa12466e664542ade30b60aa86e36bd983da3c Mon Sep 17 00:00:00 2001 From: Leilei332 Date: Wed, 7 Aug 2024 19:07:22 +0800 Subject: [PATCH] Apply proper color for target footnote background in markdown (#8492) * Use footnote-target-background index for the color of the background of target footnote * Apply proper color to palettes --- core/palettes/Blanca.tid | 1 + core/palettes/Blue.tid | 1 + core/palettes/BrightMute.tid | 1 + core/palettes/ContrastDark.tid | 1 + core/palettes/ContrastLight.tid | 1 + core/palettes/CupertinoDark.tid | 1 + core/palettes/DarkPhotos.tid | 1 + core/palettes/DesertSand.tid | 1 + core/palettes/GruvBoxDark.tid | 1 + core/palettes/Nord.tid | 1 + core/palettes/Rocker.tid | 1 + core/palettes/SolarFlare.tid | 1 + core/palettes/SolarizedDark.tid | 1 + core/palettes/SolarizedLight.tid | 1 + core/palettes/SpartanDay.tid | 1 + core/palettes/SpartanNight.tid | 1 + core/palettes/Twilight.tid | 1 + core/palettes/Vanilla.tid | 1 + plugins/tiddlywiki/markdown/styles.tid | 2 +- 19 files changed, 19 insertions(+), 1 deletion(-) diff --git a/core/palettes/Blanca.tid b/core/palettes/Blanca.tid index 0fd8e2da3..7a6e7d97b 100644 --- a/core/palettes/Blanca.tid +++ b/core/palettes/Blanca.tid @@ -33,6 +33,7 @@ external-link-background: inherit external-link-foreground-hover: inherit external-link-foreground-visited: #0000aa external-link-foreground: #0000ee +footnote-target-background: #ecf2ff foreground: #333333 highlight-background: #ffff00 highlight-foreground: #000000 diff --git a/core/palettes/Blue.tid b/core/palettes/Blue.tid index cc3846b50..b5bdecb8a 100644 --- a/core/palettes/Blue.tid +++ b/core/palettes/Blue.tid @@ -33,6 +33,7 @@ external-link-background: inherit external-link-foreground-hover: inherit external-link-foreground-visited: #0000aa external-link-foreground: #0000ee +footnote-target-background: #ecf2ff foreground: #333353 highlight-background: #ffff00 highlight-foreground: #000000 diff --git a/core/palettes/BrightMute.tid b/core/palettes/BrightMute.tid index ddbd6b3cd..2762a995d 100644 --- a/core/palettes/BrightMute.tid +++ b/core/palettes/BrightMute.tid @@ -33,6 +33,7 @@ external-link-background: inherit external-link-foreground-hover: inherit external-link-foreground-visited: #0000aa external-link-foreground: #0000ee +footnote-target-background: #ecf2ff foreground: #333333 highlight-background: #ffff00 highlight-foreground: #000000 diff --git a/core/palettes/ContrastDark.tid b/core/palettes/ContrastDark.tid index 850a5863b..a10a1b8eb 100644 --- a/core/palettes/ContrastDark.tid +++ b/core/palettes/ContrastDark.tid @@ -33,6 +33,7 @@ external-link-background: inherit external-link-foreground-hover: inherit external-link-foreground-visited: #00a external-link-foreground: #00e +footnote-target-background: #e5e5e5 foreground: #000 highlight-background: #ffff00 highlight-foreground: #000000 diff --git a/core/palettes/ContrastLight.tid b/core/palettes/ContrastLight.tid index ade9f43f8..67552b30e 100644 --- a/core/palettes/ContrastLight.tid +++ b/core/palettes/ContrastLight.tid @@ -33,6 +33,7 @@ external-link-background: inherit external-link-foreground-hover: inherit external-link-foreground-visited: #00a external-link-foreground: #00e +footnote-target-background: #4c4c4c foreground: #fff highlight-background: #ffff00 highlight-foreground: #000000 diff --git a/core/palettes/CupertinoDark.tid b/core/palettes/CupertinoDark.tid index 7f08f4100..f13fc1e16 100644 --- a/core/palettes/CupertinoDark.tid +++ b/core/palettes/CupertinoDark.tid @@ -31,6 +31,7 @@ external-link-background: transparent external-link-foreground-hover: external-link-foreground-visited: #BF5AF2 external-link-foreground: #32D74B +footnote-target-background: #747474 foreground: #FFFFFF highlight-background: #ffff78 highlight-foreground: #000000 diff --git a/core/palettes/DarkPhotos.tid b/core/palettes/DarkPhotos.tid index 71fa40f2f..5d086fc27 100644 --- a/core/palettes/DarkPhotos.tid +++ b/core/palettes/DarkPhotos.tid @@ -35,6 +35,7 @@ external-link-background: inherit external-link-foreground-hover: inherit external-link-foreground-visited: #0000aa external-link-foreground: #0000ee +footnote-target-background: #ecf2ff foreground: #333333 highlight-background: #ffff00 highlight-foreground: #000000 diff --git a/core/palettes/DesertSand.tid b/core/palettes/DesertSand.tid index ddce80e27..12b06c948 100644 --- a/core/palettes/DesertSand.tid +++ b/core/palettes/DesertSand.tid @@ -39,6 +39,7 @@ external-link-background: inherit external-link-foreground-hover: inherit external-link-foreground-visited: #313163 external-link-foreground: #555592 +footnote-target-background: #fff7d9 foreground: #2D2A23 highlight-background: #ffff00 highlight-foreground: #000000 diff --git a/core/palettes/GruvBoxDark.tid b/core/palettes/GruvBoxDark.tid index 6c3fa6a73..e839fd7b4 100644 --- a/core/palettes/GruvBoxDark.tid +++ b/core/palettes/GruvBoxDark.tid @@ -40,6 +40,7 @@ external-link-background: inherit external-link-foreground-hover: inherit external-link-foreground-visited: #d3869b external-link-foreground: #8ec07c +footnote-target-background: #665c54 foreground: #fbf1c7 highlight-background: #ffff79 highlight-foreground: #000000 diff --git a/core/palettes/Nord.tid b/core/palettes/Nord.tid index e8e280998..5f18dce3f 100644 --- a/core/palettes/Nord.tid +++ b/core/palettes/Nord.tid @@ -40,6 +40,7 @@ external-link-background: inherit external-link-foreground-hover: inherit external-link-foreground-visited: #5E81AC external-link-foreground: #8FBCBB +footnote-target-background: #2E3440 foreground: #d8dee9 highlight-background: #ffff78 highlight-foreground: #000000 diff --git a/core/palettes/Rocker.tid b/core/palettes/Rocker.tid index a91cd1b5f..c6693eb52 100644 --- a/core/palettes/Rocker.tid +++ b/core/palettes/Rocker.tid @@ -33,6 +33,7 @@ external-link-background: inherit external-link-foreground-hover: inherit external-link-foreground-visited: #0000aa external-link-foreground: #0000ee +footnote-target-background: #ecf2ff foreground: #333333 highlight-background: #ffff00 highlight-foreground: #000000 diff --git a/core/palettes/SolarFlare.tid b/core/palettes/SolarFlare.tid index 4d81bf531..932256665 100644 --- a/core/palettes/SolarFlare.tid +++ b/core/palettes/SolarFlare.tid @@ -131,6 +131,7 @@ external-link-background-hover: inherit external-link-background-visited: inherit external-link-background: inherit external-link-foreground-hover: inherit +footnote-target-background: #ded8c5 highlight-background: #ffff00 highlight-foreground: #000000 message-border: #cfd6e6 diff --git a/core/palettes/SolarizedDark.tid b/core/palettes/SolarizedDark.tid index bacd385b2..326f6a4fb 100644 --- a/core/palettes/SolarizedDark.tid +++ b/core/palettes/SolarizedDark.tid @@ -34,6 +34,7 @@ external-link-background-visited: inherit external-link-foreground: #268bd2 external-link-foreground-hover: external-link-foreground-visited: #268bd2 +footnote-target-background: #073642 foreground: #839496 highlight-background: #ffff78 highlight-foreground: #000000 diff --git a/core/palettes/SolarizedLight.tid b/core/palettes/SolarizedLight.tid index 5d8757386..28ce1c7c2 100644 --- a/core/palettes/SolarizedLight.tid +++ b/core/palettes/SolarizedLight.tid @@ -34,6 +34,7 @@ external-link-background-visited: inherit external-link-foreground: #268bd2 external-link-foreground-hover: inherit external-link-foreground-visited: #268bd2 +footnote-target-background: #eee8d5 foreground: #657b83 highlight-background: #ffff00 highlight-foreground: #000000 diff --git a/core/palettes/SpartanDay.tid b/core/palettes/SpartanDay.tid index cc197144e..505427d33 100644 --- a/core/palettes/SpartanDay.tid +++ b/core/palettes/SpartanDay.tid @@ -33,6 +33,7 @@ external-link-background: transparent external-link-foreground-hover: external-link-foreground-visited: external-link-foreground: +footnote-target-background: #ececec foreground: rgba(0, 0, 0, 0.87) highlight-background: #ffff00 highlight-foreground: #000000 diff --git a/core/palettes/SpartanNight.tid b/core/palettes/SpartanNight.tid index dc47a0774..b36ecb526 100644 --- a/core/palettes/SpartanNight.tid +++ b/core/palettes/SpartanNight.tid @@ -33,6 +33,7 @@ external-link-background: transparent external-link-foreground-hover: external-link-foreground-visited: #7c318c external-link-foreground: #9e3eb3 +footnote-target-background: #494949 foreground: rgba(255, 255, 255, 0.7) highlight-background: #ffff78 highlight-foreground: #000000 diff --git a/core/palettes/Twilight.tid b/core/palettes/Twilight.tid index 4c127f822..1cd8efab1 100644 --- a/core/palettes/Twilight.tid +++ b/core/palettes/Twilight.tid @@ -42,6 +42,7 @@ external-link-background-visited: inherit external-link-foreground: rgb(179, 179, 255) external-link-foreground-hover: inherit external-link-foreground-visited: rgb(153, 153, 255) +footnote-target-background: <> foreground: rgb(179, 179, 179) highlight-background: #ffff78 highlight-foreground: #000000 diff --git a/core/palettes/Vanilla.tid b/core/palettes/Vanilla.tid index 067f32519..76307acee 100644 --- a/core/palettes/Vanilla.tid +++ b/core/palettes/Vanilla.tid @@ -41,6 +41,7 @@ external-link-background: inherit external-link-foreground-hover: inherit external-link-foreground-visited: #0000aa external-link-foreground: #0000ee +footnote-target-background: #ecf2ff foreground: #333333 highlight-background: #ffff00 highlight-foreground: #000000 diff --git a/plugins/tiddlywiki/markdown/styles.tid b/plugins/tiddlywiki/markdown/styles.tid index f4d953d1b..4185d4304 100644 --- a/plugins/tiddlywiki/markdown/styles.tid +++ b/plugins/tiddlywiki/markdown/styles.tid @@ -36,7 +36,7 @@ code-body: yes margin-left: 0.25em; } .markdown a.footnote-ref:target, .markdown .footnote-item:target { - background-color: <>; + background-color: <>; scroll-margin-top: {{{ [{$:/themes/tiddlywiki/vanilla/options/stickytitles}match[yes]then[120px]else[60px]] }}}; } .markdown li > p:first-child {