1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-18 07:44:51 +00:00
TiddlyWiki5/core/wiki/currpalettepreview.tid

48 lines
1.4 KiB
Plaintext
Raw Normal View History

2014-02-20 10:00:38 +00:00
title: $:/snippets/currpalettepreview
\define resolve-colour(macrocall)
\import $:/core/macros/utils
\whitespace trim
<$wikify name="name" text="""$macrocall$""">
<<name>>
</$wikify>
\end
2014-02-20 10:00:38 +00:00
\define swatchStyle()
background-color: $(swatchColour)$;
\end
\define swatch-inner()
<$set name="swatchColour" value={{##$(colourResolved)$}}>
<$list filter="[<swatchColour>!prefix[<<colour ]!suffix[>>]]" variable="ignore">
<div class="tc-swatch" style=<<swatchStyle>> title=<<swatchTitle>>/>
</$list>
<$list filter="[<swatchColour>prefix[<<colour ]suffix[>>]]" variable="ignore">
<$wikify name="colourResolved" text="""<$macrocall $name="resolve-colour" macrocall=<<swatchColour>>/>""">
<<swatch-inner>>
</$wikify>
</$list>
</$set>
\end
\define swatch()
<$set name="swatchColour" value={{##$(colour)$}}>
<$set name="swatchTitle" value=<<colour>>>
<$list filter="[<swatchColour>!prefix[<<colour ]!suffix[>>]]" variable="ignore">
<div class="tc-swatch" style=<<swatchStyle>> title=<<swatchTitle>>/>
</$list>
<$list filter="[<swatchColour>prefix[<<colour ]suffix[>>]]" variable="ignore">
<$wikify name="colourResolved" text="""<$macrocall $name="resolve-colour" macrocall=<<swatchColour>>/>""">
<<swatch-inner>>
</$wikify>
</$list>
</$set>
</$set>
2014-02-20 10:00:38 +00:00
\end
<div class="tc-swatches-horiz"><$list filter="
foreground
background
muted-foreground
primary
page-background
tab-background
tiddler-info-background
" variable="colour"><<swatch>></$list></div>