mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-20 16:42:02 +00:00
Add palette editor
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
title: $:/snippets/currpalettepreview
|
||||
|
||||
\define swatchStyle()
|
||||
background-color: $(swatchColour)$;
|
||||
\end
|
||||
\define swatch(colour)
|
||||
<$set name="swatchColour" value={{##$colour$}}>
|
||||
<div class="tw-swatch" style=<<swatchStyle>>/>
|
||||
</$set>
|
||||
\end
|
||||
<div class="tw-swatches-horiz">
|
||||
<<swatch foreground>>
|
||||
<<swatch background>>
|
||||
<<swatch muted-foreground>>
|
||||
<<swatch primary>>
|
||||
<<swatch page-background>>
|
||||
<<swatch tab-background>>
|
||||
<<swatch tiddler-info-background>>
|
||||
</div>
|
||||
@@ -0,0 +1,25 @@
|
||||
title: $:/snippets/paletteeditor
|
||||
|
||||
<$set name="currentTiddler" value={{$:/palette}}>
|
||||
|
||||
Editing <$link to={{$:/palette}}><$macrocall $name="currentTiddler" $output="text/plain"/></$link>
|
||||
|
||||
<$list filter="[is[current]is[shadow]is[tiddler]]" variable="listItem">
|
||||
This shadow palette has been modified
|
||||
<$button message="tw-delete-tiddler" param={{$:/palette}}>reset</$button>
|
||||
</$list>
|
||||
|
||||
<$list filter="[is[current]is[shadow]!is[tiddler]]" variable="listItem">
|
||||
It is recommended that you clone this shadow palette before editing it
|
||||
</$list>
|
||||
|
||||
<$button message="tw-new-tiddler" param={{$:/palette}}>clone</$button>
|
||||
|
||||
<table><tbody><$list filter="[is[current]indexes[]]" variable="colourName"><tr><td><$macrocall $name="colourName" $output="text/plain"/></td>
|
||||
<td><$edit-text index=<<colourName>> tag="input"/></td>
|
||||
<td><$edit-text index=<<colourName>> type="color" tag="input"/></td>
|
||||
</tr>
|
||||
</$list>
|
||||
</tbody>
|
||||
</table>
|
||||
</$set>
|
||||
@@ -1,20 +1,5 @@
|
||||
title: $:/snippets/palettepreview
|
||||
|
||||
\define swatchStyle()
|
||||
background-color: $(swatchColour)$;
|
||||
\end
|
||||
\define swatch(colour)
|
||||
<$set name="currentTiddler" value={{$:/palette}}>
|
||||
<$set name="swatchColour" value={{##$colour$}}>
|
||||
<div class="tw-swatch" style=<<swatchStyle>>/>
|
||||
<$transclude tiddler="$:/snippets/currpalettepreview"/>
|
||||
</$set>
|
||||
</$set>
|
||||
\end
|
||||
|
||||
<div class="tw-swatches-horiz">
|
||||
<<swatch foreground>>
|
||||
<<swatch background>>
|
||||
<<swatch muted-foreground>>
|
||||
<<swatch primary>>
|
||||
<<swatch page-background>>
|
||||
</div>
|
||||
|
||||
@@ -3,9 +3,8 @@ title: $:/snippets/paletteswitcher
|
||||
\define lingo-base() $:/language/ControlPanel/Appearance/Palette/
|
||||
<<lingo Prompt>> <$view tiddler={{$:/palette}} field="name"/>
|
||||
|
||||
{{$:/snippets/palettepreview}}
|
||||
|
||||
<$linkcatcher to="$:/palette">
|
||||
<$list filter="[is[shadow]tag[$:/tags/Palette]] [!is[shadow]tag[$:/tags/Palette]] +[sort[description]]"><div><$reveal state="$:/palette" type="match" text={{!!title}}>•</$reveal><$reveal state="$:/palette" type="nomatch" text={{!!title}}> </$reveal> <$link to={{!!title}}>''<$view field="name" format="text"/>'' - <$view field="description" format="text"/></$link></div>
|
||||
<div class="tw-chooser"><$list filter="[is[shadow]tag[$:/tags/Palette]] [!is[shadow]tag[$:/tags/Palette]] +[sort[description]]"><div class="tw-chooser-item"><$link to={{!!title}}><div><$reveal state="$:/palette" type="match" text={{!!title}}>•</$reveal><$reveal state="$:/palette" type="nomatch" text={{!!title}}> </$reveal> ''<$view field="name" format="text"/>'' - <$view field="description" format="text"/></div><$transclude tiddler="$:/snippets/currpalettepreview"/></$link></div>
|
||||
</$list>
|
||||
</div>
|
||||
</$linkcatcher>
|
||||
Reference in New Issue
Block a user