So I’m making a blackout palette that pairs with an edit of the tag macro tiddler, and I was planning to use the reveal widget to only show the changes to the tag macro when the specific palette was used, forgetting that if a definition isn’t on the first line, it won’t really work…
Here’s what I tried, for better reference:
title: $:/core/macros/tag/oled
tags: $:/tags/Macro
text:
<$reveal state="$:/palette" type="match" text="$:/palettes/Dark" default="$:/palettes/Dark">
\define tag-pill-styles()
background-color:$(foregroundColor)$;
fill:$(backgroundColor)$;
color:$(backgroundColor)$;
\end
\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
\whitespace trim
<$vars
foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">>
backgroundColor=<<__colour__>>
>
<$element-tag$
$element-attributes$
class="tc-tag-label tc-btn-invisible"
style=<<tag-pill-styles>>
>
<<__actions__>>
<$transclude tiddler=<<__icon__>>/>
<$view tiddler=<<__tag__>> field="title" format="text" />
</$element-tag$>
\end
\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
\whitespace trim
<$macrocall $name="tag-pill-inner"
tag=<<__tag__>>
icon=<<__icon__>>
colour=<<__colour__>>
fallbackTarget={{$palette$##page-background}}
colourA={{$palette$##page-background}}
colourB={{$palette$##foreground}}
element-tag=<<__element-tag__>>
element-attributes=<<__element-attributes__>>
actions=<<__actions__>>
/>
\end
</$reveal>
I’d like to either hide the text or remove the $:/tags/Macro
if $:/palettes/Dark
isn’t the selected palette, and not needing a button.
Does anyone have any suggestions?