The appearance of each TOC item is controlled by the toc-caption() macro definition which is found in the $:/core/macros/toc TWCore shadow tiddler:
\define toc-caption()
\whitespace trim
<span class="tc-toc-caption tc-tiny-gap-left">
<$set name="tv-wikilinks" value="no">
<$transclude field="caption">
<$view field="title"/>
</$transclude>
</$set>
</span>
\end
To change this definition, you do NOT need to modify the TWCore shadow tiddler. Instead, just paste the above macro definition into a new tiddler (e.g., “MyTOCCaption”), and tag that tiddler with $:/tags/Global.
Then, to add your desired CSS style rule, you can modify that copy of the macro definition by changing this line:
<span class="tc-toc-caption tc-tiny-gap-left">
to this:
<span class="tc-toc-caption tc-tiny-gap-left"
style={{{ [<currentTiddler>tag[draft]then[opacity:0.5]] }}}>
Notes:
- Within the TOC code, the
currentTiddler variable is used to refer to each TOC item being rendered
- The added
style=... attribute uses a “filtered transclusion” (the triple curly syntax) to see if the currentTiddler is tagged with “draft” and, if it is, it applies the opacity:0.5 style to the TOC item output.
enjoy,
-e