kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Add colour swatches to palette switcher
rodzic
3f89d2d0fa
commit
e1dfb621f5
|
@ -1,5 +1,8 @@
|
||||||
title: $:/core/ui/PageMacros
|
title: $:/core/ui/PageMacros
|
||||||
|
|
||||||
|
\define colour(name)
|
||||||
|
<$transclude tiddler={{$:/palette}} index="$name$"/>
|
||||||
|
\end
|
||||||
\define tabs(tabsList,default,state:"$:/state/tab")
|
\define tabs(tabsList,default,state:"$:/state/tab")
|
||||||
<div class="tw-tab-buttons"><$list filter="$tabsList$" variable="currentTab"><$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tw-tab-selected"><$transclude tiddler=<<currentTab>> field="caption"><$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/></$transclude> </$button>
|
<div class="tw-tab-buttons"><$list filter="$tabsList$" variable="currentTab"><$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tw-tab-selected"><$transclude tiddler=<<currentTab>> field="caption"><$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/></$transclude> </$button>
|
||||||
</$list>
|
</$list>
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
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>>/>
|
||||||
|
</$set>
|
||||||
|
</$set>
|
||||||
|
\end
|
||||||
|
|
||||||
|
<div class="tw-swatches-horiz">
|
||||||
|
<<swatch foreground>>
|
||||||
|
<<swatch background>>
|
||||||
|
<<swatch muted-foreground>>
|
||||||
|
<<swatch primary>>
|
||||||
|
<<swatch page-background>>
|
||||||
|
</div>
|
|
@ -3,6 +3,8 @@ title: $:/snippets/paletteswitcher
|
||||||
\define lingo-base() $:/language/ControlPanel/Appearance/Palette/
|
\define lingo-base() $:/language/ControlPanel/Appearance/Palette/
|
||||||
<<lingo Prompt>> <$view tiddler={{$:/palette}} field="name"/>
|
<<lingo Prompt>> <$view tiddler={{$:/palette}} field="name"/>
|
||||||
|
|
||||||
|
{{$:/snippets/palettepreview}}
|
||||||
|
|
||||||
<$linkcatcher to="$:/palette">
|
<$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>
|
<$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>
|
||||||
</$list>
|
</$list>
|
||||||
|
|
|
@ -993,3 +993,22 @@ canvas.tw-edit-bitmapeditor {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
margin: 0px 0px 12px 12px;
|
margin: 0px 0px 12px 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Palette swatches
|
||||||
|
*/
|
||||||
|
|
||||||
|
.tw-swatches-horiz {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.tw-swatches-horiz .tw-swatch {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tw-swatch {
|
||||||
|
width: 2em;
|
||||||
|
height: 2em;
|
||||||
|
margin: 4px;
|
||||||
|
border: 1px solid #000;
|
||||||
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue