mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-07 22:33:50 +00:00
Introduce new static palette architecture
This commit is contained in:
parent
1be89a28bf
commit
f88915728f
151
core/palette-templates/TwentyTwenties.tid
Normal file
151
core/palette-templates/TwentyTwenties.tid
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
title: $:/palettes/TwentyTwenties
|
||||||
|
name: TwentyTwenties
|
||||||
|
description: Modern and flexible
|
||||||
|
tags: $:/tags/Palette
|
||||||
|
type: application/x-tiddler-dictionary
|
||||||
|
color-scheme: light
|
||||||
|
palette-type: modern
|
||||||
|
|
||||||
|
alert-background: #ffe476
|
||||||
|
alert-border: #b99e2f
|
||||||
|
alert-highlight: #881122
|
||||||
|
alert-muted-foreground: #b99e2f
|
||||||
|
background: #ffffff
|
||||||
|
blockquote-bar: [function[colour],[muted-foreground]]
|
||||||
|
button-background:
|
||||||
|
button-foreground:
|
||||||
|
button-border:
|
||||||
|
code-background: #f7f7f9
|
||||||
|
code-border: #e1e1e8
|
||||||
|
code-foreground: #dd1144
|
||||||
|
diff-delete-background: #ffc9c9
|
||||||
|
diff-delete-foreground: [function[colour],[foreground]]
|
||||||
|
diff-equal-background:
|
||||||
|
diff-equal-foreground: [function[colour],[foreground]]
|
||||||
|
diff-insert-background: #aaefad
|
||||||
|
diff-insert-foreground: [function[colour],[foreground]]
|
||||||
|
diff-invisible-background:
|
||||||
|
diff-invisible-foreground: [function[colour],[muted-foreground]]
|
||||||
|
dirty-indicator: #ff0000
|
||||||
|
download-background: #34c734
|
||||||
|
download-foreground: [function[colour],[background]]
|
||||||
|
dragger-background: [function[colour],[foreground]]
|
||||||
|
dragger-foreground: [function[colour],[background]]
|
||||||
|
dropdown-background: [function[colour],[background]]
|
||||||
|
dropdown-border: [function[colour],[muted-foreground]]
|
||||||
|
dropdown-tab-background-selected: #ffffff
|
||||||
|
dropdown-tab-background: #ececec
|
||||||
|
dropzone-background: rgba(0,200,0,0.7)
|
||||||
|
external-link-background-hover: inherit
|
||||||
|
external-link-background-visited: inherit
|
||||||
|
external-link-background: inherit
|
||||||
|
external-link-foreground-hover: inherit
|
||||||
|
external-link-foreground-visited: #0000aa
|
||||||
|
external-link-foreground: #0000ee
|
||||||
|
footnote-target-background: #ecf2ff
|
||||||
|
foreground: #333333
|
||||||
|
highlight-background: #ffff00
|
||||||
|
highlight-foreground: #000000
|
||||||
|
message-background: #ecf2ff
|
||||||
|
message-border: #cfd6e6
|
||||||
|
message-foreground: #547599
|
||||||
|
modal-backdrop: [function[colour],[foreground]]
|
||||||
|
modal-background: [function[colour],[background]]
|
||||||
|
modal-border: #999999
|
||||||
|
modal-footer-background: #f5f5f5
|
||||||
|
modal-footer-border: #dddddd
|
||||||
|
modal-header-border: #eeeeee
|
||||||
|
muted-foreground: #bbbbbb
|
||||||
|
network-activity-foreground: #448844
|
||||||
|
notification-background: #ffffdd
|
||||||
|
notification-border: #999999
|
||||||
|
page-background: [function[colour],[primary]colour-oklch[0.9]]
|
||||||
|
pre-background: #f5f5f5
|
||||||
|
pre-border: #cccccc
|
||||||
|
primary: #5778d8
|
||||||
|
selection-background:
|
||||||
|
selection-foreground:
|
||||||
|
select-tag-background:
|
||||||
|
select-tag-foreground:
|
||||||
|
sidebar-button-foreground: [function[colour],[foreground]]
|
||||||
|
sidebar-controls-foreground-hover: #000000
|
||||||
|
sidebar-controls-foreground: #aaaaaa
|
||||||
|
sidebar-foreground-shadow: rgba(255,255,255, 0.8)
|
||||||
|
sidebar-foreground: #acacac
|
||||||
|
sidebar-muted-foreground-hover: #444444
|
||||||
|
sidebar-muted-foreground: #c0c0c0
|
||||||
|
sidebar-tab-background-selected: #f4f4f4
|
||||||
|
sidebar-tab-background: #e0e0e0
|
||||||
|
sidebar-tab-border-selected: [function[colour],[tab-border-selected]]
|
||||||
|
sidebar-tab-border: [function[colour],[tab-border]]
|
||||||
|
sidebar-tab-divider: #e4e4e4
|
||||||
|
sidebar-tab-foreground-selected:
|
||||||
|
sidebar-tab-foreground: [function[colour],[tab-foreground]]
|
||||||
|
sidebar-tiddler-link-foreground-hover: #444444
|
||||||
|
sidebar-tiddler-link-foreground: #999999
|
||||||
|
site-title-foreground: [function[colour],[tiddler-title-foreground]]
|
||||||
|
stability-stable: #008000
|
||||||
|
stability-experimental: #c07c00
|
||||||
|
stability-deprecated: #ff0000
|
||||||
|
stability-legacy: #0000ff
|
||||||
|
static-alert-foreground: #aaaaaa
|
||||||
|
tab-background-selected: #ffffff
|
||||||
|
tab-background: #d8d8d8
|
||||||
|
tab-border-selected: #d8d8d8
|
||||||
|
tab-border: #cccccc
|
||||||
|
tab-divider: #d8d8d8
|
||||||
|
tab-foreground-selected: [function[colour],[tab-foreground]]
|
||||||
|
tab-foreground: #666666
|
||||||
|
table-border: #dddddd
|
||||||
|
table-footer-background: #a8a8a8
|
||||||
|
table-header-background: #f0f0f0
|
||||||
|
tag-background: #eecc66
|
||||||
|
tag-foreground: #ffffff
|
||||||
|
testcase-accent-level-1: #c1eaff
|
||||||
|
testcase-accent-level-2: #E3B740
|
||||||
|
testcase-accent-level-3: #5FD564
|
||||||
|
tiddler-background: [function[colour],[primary]colour-oklch[0.95]]
|
||||||
|
tiddler-border: [function[colour],[background]]
|
||||||
|
tiddler-controls-foreground-hover: #888888
|
||||||
|
tiddler-controls-foreground-selected: #444444
|
||||||
|
tiddler-controls-foreground: #cccccc
|
||||||
|
tiddler-editor-background: #f8f8f8
|
||||||
|
tiddler-editor-border-image: #ffffff
|
||||||
|
tiddler-editor-border: #cccccc
|
||||||
|
tiddler-editor-fields-even: #e0e8e0
|
||||||
|
tiddler-editor-fields-odd: #f0f4f0
|
||||||
|
tiddler-info-background: #f8f8f8
|
||||||
|
tiddler-info-border: #dddddd
|
||||||
|
tiddler-info-tab-background: #f8f8f8
|
||||||
|
tiddler-link-background: [function[colour],[background]]
|
||||||
|
tiddler-link-foreground: [function[colour],[primary]]
|
||||||
|
tiddler-subtitle-foreground: #c0c0c0
|
||||||
|
tiddler-title-foreground: #182955
|
||||||
|
toolbar-new-button:
|
||||||
|
toolbar-options-button:
|
||||||
|
toolbar-save-button:
|
||||||
|
toolbar-info-button:
|
||||||
|
toolbar-edit-button:
|
||||||
|
toolbar-close-button:
|
||||||
|
toolbar-delete-button:
|
||||||
|
toolbar-cancel-button:
|
||||||
|
toolbar-done-button:
|
||||||
|
untagged-background: #999999
|
||||||
|
very-muted-foreground: #888888
|
||||||
|
wikilist-background: #e5e5e5
|
||||||
|
wikilist-item: #ffffff
|
||||||
|
wikilist-info: #000000
|
||||||
|
wikilist-title: #666666
|
||||||
|
wikilist-title-svg: [function[colour],[wikilist-title]]
|
||||||
|
wikilist-url: #aaaaaa
|
||||||
|
wikilist-button-open: #4fb82b
|
||||||
|
wikilist-button-open-hover: green
|
||||||
|
wikilist-button-reveal: #5778d8
|
||||||
|
wikilist-button-reveal-hover: blue
|
||||||
|
wikilist-button-remove: #d85778
|
||||||
|
wikilist-button-remove-hover: red
|
||||||
|
wikilist-toolbar-background: #d3d3d3
|
||||||
|
wikilist-toolbar-foreground: #888888
|
||||||
|
wikilist-droplink-dragover: rgba(255,192,192,0.5)
|
||||||
|
wikilist-button-background: #acacac
|
||||||
|
wikilist-button-foreground: #000000
|
@ -1,17 +1,44 @@
|
|||||||
title: $:/core/macros/CSS
|
title: $:/core/macros/CSS
|
||||||
tags: $:/tags/Macro
|
tags: $:/tags/Macro
|
||||||
|
|
||||||
<!-- Needs to stay that way for backwards compatibility. See GH issue: #8326 -->
|
\procedure actions-compile-palette(inputTitle,outputTitle)
|
||||||
\define colour(name)
|
<!-- Redefine colour function to use the input palette -->
|
||||||
\whitespace trim
|
\function colour(name)
|
||||||
<$transclude tiddler={{$:/palette}} index="$name$">
|
[<inputTitle>getindex<name>] :else[[$:/config/DefaultColourMappings/]addsuffix<name>get[text]]
|
||||||
<$transclude tiddler="$:/palettes/Vanilla" index="$name$">
|
\end colour
|
||||||
<$transclude tiddler="$:/config/DefaultColourMappings/$name$"/>
|
<!-- Process modern filter-based palettes -->
|
||||||
</$transclude>
|
<%if [<inputTitle>get[palette-type]match[modern]] %>
|
||||||
</$transclude>
|
<$list filter="[<inputTitle>indexes[]sort[]]" variable="colour-name">
|
||||||
\end
|
<$let colour-filter={{{ [<inputTitle>getindex<colour-name>] }}}>
|
||||||
|
<!-- Note the join, needed to cope with palette entries containing spaces -->
|
||||||
|
<$action-setfield $tiddler=<<outputTitle>> $index=<<colour-name>> $value={{{ [subfilter<colour-filter>join[ ]] }}}/>
|
||||||
|
</$let>
|
||||||
|
</$list>
|
||||||
|
<%else%>
|
||||||
|
<!-- Process legacy wikified palettes -->
|
||||||
|
<$list filter="[<inputTitle>indexes[]sort[]]" variable="colour-name">
|
||||||
|
<$wikify name="colour-value" text={{{ [<inputTitle>getindex<colour-name>] }}} mode="inline">
|
||||||
|
<$action-setfield $tiddler=<<outputTitle>> $index=<<colour-name>> $value=<<colour-value>>/>
|
||||||
|
</$wikify>
|
||||||
|
</$list>
|
||||||
|
<%endif%>
|
||||||
|
\end actions-compile-palette
|
||||||
|
|
||||||
\define color(name) <<colour $name$>>
|
\procedure actions-switch-colour-palette(paletteTitle)
|
||||||
|
<$action-log $msg="switching palette" $to=<<paletteTitle>> actions-compile-palette=<<actions-compile-palette>>/>
|
||||||
|
<$action-deletetiddler $tiddler="$:/temp/palette-colours"/>
|
||||||
|
<$action-setfield $tiddler="$:/palette" $field="text" $value=<<paletteTitle>>/>
|
||||||
|
<$transclude $variable="actions-compile-palette" inputTitle="$:/palettes/Vanilla" outputTitle="$:/temp/palette-colours"/>
|
||||||
|
<$transclude $variable="actions-compile-palette" inputTitle=<<paletteTitle>> outputTitle="$:/temp/palette-colours"/>
|
||||||
|
\end actions-switch-colour-palette
|
||||||
|
|
||||||
|
\function colour(name)
|
||||||
|
[[$:/temp/palette-colours]getindex<name>] :else[[$:/config/DefaultColourMappings/]addsuffix<name>get[text]]
|
||||||
|
\end colour
|
||||||
|
|
||||||
|
\function color(name)
|
||||||
|
[function[colour],<name>]
|
||||||
|
\end color
|
||||||
|
|
||||||
\define box-shadow(shadow)
|
\define box-shadow(shadow)
|
||||||
``
|
``
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
title: $:/snippets/paletteswitcher
|
title: $:/snippets/paletteswitcher
|
||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$linkcatcher to="$:/palette">
|
\procedure actions()
|
||||||
|
<$transclude $variable="actions-switch-colour-palette" paletteTitle=<<navigateTo>>/>
|
||||||
|
\end actions
|
||||||
|
|
||||||
|
<$linkcatcher actions=<<actions>>>
|
||||||
<div class="tc-chooser tc-chooser-cards">
|
<div class="tc-chooser tc-chooser-cards">
|
||||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]sort[name]]">
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]sort[name]]">
|
||||||
<$set name="cls" filter="[all[current]prefix{$:/palette}]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">
|
<$set name="cls" filter="[all[current]prefix{$:/palette}]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">
|
||||||
|
5
core/wiki/startup-actions/set-palette.tid
Normal file
5
core/wiki/startup-actions/set-palette.tid
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
title: $:/core/wiki/startup-actions/set-palette
|
||||||
|
tags: $:/tags/StartupAction
|
||||||
|
|
||||||
|
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||||
|
<$transclude $variable="actions-switch-colour-palette" paletteTitle={{$:/palette}}/>
|
Loading…
x
Reference in New Issue
Block a user