diff --git a/core/wiki/macros/tag.tid b/core/wiki/macros/tag.tid
index 0dfe8e52a..eedbd0c4c 100644
--- a/core/wiki/macros/tag.tid
+++ b/core/wiki/macros/tag.tid
@@ -21,7 +21,9 @@ color:$(foregroundColor)$;
>
<<__actions__>>
<$transclude tiddler=<<__icon__>>/>
- <$view tiddler=<<__tag__>> field="title" format="text" />
+ is[missing]then[tc-tag-missing]else[tc-tag-exists]] }}}>
+ <$view tiddler=<<__tag__>> field="title" format="text" />
+
$element-tag$>
$let>
\end
diff --git a/editions/tw5.com/tiddlers/macros/TagMacro.tid b/editions/tw5.com/tiddlers/macros/TagMacro.tid
index eda75dcb9..f90eb44b7 100644
--- a/editions/tw5.com/tiddlers/macros/TagMacro.tid
+++ b/editions/tw5.com/tiddlers/macros/TagMacro.tid
@@ -1,6 +1,6 @@
caption: tag
created: 20141206130540337
-modified: 20230725201240201
+modified: 20240228131301798
tags: Macros [[Core Macros]]
title: tag Macro
type: text/vnd.tiddlywiki
@@ -11,7 +11,35 @@ The <<.def tag>> [[macro|Macros]] generates a tag pill for a specified tag. Clic
!! Parameters
-;tag
+; tag
: The title of the tag, defaulting to the [[current tiddler|Current Tiddler]]
+!! CSS classes
+
+<<.from-version "v5.3.4">>
+
+; `tc-tag-missing`
+: This class is defined if a tag does ''not exist'' as a tiddler.
+
+; `tc-tag-exists`
+: This class is defined if a tag does exist as a tiddler
+
+!!! Defining the class
+
+To define the `tc-tag-missing` class a stylesheet tiddler needs to be created. The default font-style for missing tiddler links is //italic//, so it's used for the example code below. Eg:
+
+''title:'' `myTagsStylesheet`
+''tag:'' `$:/tags/Stylesheet`
+
+<>
+```
+.tc-tag-missing {
+ font-style: italic;
+}
+```
+
<<.macro-examples "tag">>
diff --git a/editions/tw5.com/tiddlers/macros/examples/tag.tid b/editions/tw5.com/tiddlers/macros/examples/tag.tid
index 103a5eab7..fbbeffb8e 100644
--- a/editions/tw5.com/tiddlers/macros/examples/tag.tid
+++ b/editions/tw5.com/tiddlers/macros/examples/tag.tid
@@ -1,5 +1,5 @@
created: 20150221211317000
-modified: 20230725203751870
+modified: 20240228131331605
tags: [[tag Macro]] [[Macro Examples]]
title: tag Macro (Examples)
type: text/vnd.tiddlywiki
@@ -7,22 +7,26 @@ type: text/vnd.tiddlywiki
<$macrocall $name=".example" n="1" eg="""<>"""/>
<$macrocall $name=".example" n="2" eg="""<>"""/>
+The Following tag can be shown with a font-style: //italic// if the corresponding stylesheet exists. See: [[tag Macro]]
+
+<$macrocall $name=".example" n="3" eg="""<>"""/>
+
If a [[list widget|ListWidget]] generates multiple tag macros for the same tag, clicking any of them opens dropdowns on all of them, as in the example below. This is usually unwanted.
-<$macrocall $name=".example" n="3" eg="""<$list filter="[tag[HelloThere]]">
+<$macrocall $name=".example" n="4" eg="""<$list filter="[tag[HelloThere]]">
* <$link/> is tagged with: <$list filter="[tags[]]"> <> $list>
$list>"""/>
Adding the `counter="transclusion"` attribute to the list widget that generates multiple identical tag macros causes each of them to be identified as a unique one. Clicking on any of them opens only a single dropdown.
-<$macrocall $name=".example" n="4" eg="""<$list filter="[tag[HelloThere]]" counter="transclusion">
+<$macrocall $name=".example" n="5" eg="""<$list filter="[tag[HelloThere]]" counter="transclusion">
* <$link/> is tagged with: <$list filter="[tags[]]"> <> $list>
$list>"""/>
A slightly more performant option is to use the `variable="transclusion"` attribute in the list widget. In this case, the variable `<>` has to be used inside the list widget instead of the `<>` .
-<$macrocall $name=".example" n="5" eg="""<$list filter="[tag[HelloThere]]" variable="transclusion">
+<$macrocall $name=".example" n="6" eg="""<$list filter="[tag[HelloThere]]" variable="transclusion">
* <$link to=<>/> is tagged with: <$list filter="[tags[]]"> <> $list>