2014-12-06 13:44:08 +00:00
|
|
|
title: $:/core/macros/tag
|
|
|
|
tags: $:/tags/Macro
|
|
|
|
|
2016-11-28 19:17:25 +00:00
|
|
|
\define tag-pill-styles()
|
|
|
|
background-color:$(backgroundColor)$;
|
|
|
|
fill:$(foregroundColor)$;
|
|
|
|
color:$(foregroundColor)$;
|
|
|
|
\end
|
|
|
|
|
|
|
|
\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
|
|
|
|
<$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>>>
|
2019-11-07 12:39:14 +00:00
|
|
|
$actions$<$transclude tiddler="""$icon$"""/><$view tiddler=<<__tag__>> field="title" format="text" />
|
2016-11-28 19:17:25 +00:00
|
|
|
</$element-tag$>
|
|
|
|
</$vars>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
|
2018-11-06 21:35:36 +00:00
|
|
|
<$macrocall $name="tag-pill-inner" tag=<<__tag__>> icon="""$icon$""" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
|
2016-11-28 19:17:25 +00:00
|
|
|
\end
|
|
|
|
|
|
|
|
\define tag-pill(tag,element-tag:"span",element-attributes:"",actions:"")
|
2021-03-13 13:19:12 +00:00
|
|
|
<span class="tc-tag-list-item" data-tag-title=<<__tag__>>>
|
2018-11-06 21:35:36 +00:00
|
|
|
<$macrocall $name="tag-pill-body" tag=<<__tag__>> icon={{{ [<__tag__>get[icon]] }}} colour={{{ [<__tag__>get[color]] }}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
|
2016-11-28 19:17:25 +00:00
|
|
|
</span>
|
|
|
|
\end
|
|
|
|
|
2014-12-06 13:44:08 +00:00
|
|
|
\define tag(tag)
|
2016-12-16 17:25:03 +00:00
|
|
|
{{$tag$||$:/core/ui/TagTemplate}}
|
2014-12-06 13:44:08 +00:00
|
|
|
\end
|