From 4afde5a722afc91c826305800ba536c5fe8ef2e5 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 28 Feb 2020 14:31:02 +0000 Subject: [PATCH] Enhance colour macro with a fallback to a configuration tiddler --- core/wiki/macros/CSS.tid | 2 +- editions/tw5.com/tiddlers/macros/ColourMacro.tid | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/wiki/macros/CSS.tid b/core/wiki/macros/CSS.tid index a5b68ea07..563f917a9 100644 --- a/core/wiki/macros/CSS.tid +++ b/core/wiki/macros/CSS.tid @@ -2,7 +2,7 @@ title: $:/core/macros/CSS tags: $:/tags/Macro \define colour(name) -<$transclude tiddler={{$:/palette}} index="$name$"><$transclude tiddler="$:/palettes/Vanilla" index="$name$"/> +<$transclude tiddler={{$:/palette}} index="$name$"><$transclude tiddler="$:/palettes/Vanilla" index="$name$"><$transclude tiddler="$:/config/DefaultColourMappings/$name$"/> \end \define color(name) diff --git a/editions/tw5.com/tiddlers/macros/ColourMacro.tid b/editions/tw5.com/tiddlers/macros/ColourMacro.tid index d63bcb3ec..584556fc7 100644 --- a/editions/tw5.com/tiddlers/macros/ColourMacro.tid +++ b/editions/tw5.com/tiddlers/macros/ColourMacro.tid @@ -1,5 +1,5 @@ created: 20150221154058000 -modified: 20150221154522000 +modified: 20200228142855357 tags: Macros [[Core Macros]] title: colour Macro type: text/vnd.tiddlywiki @@ -7,7 +7,7 @@ caption: colour The <<.def colour>> (or <<.def color>>) [[macro|Macros]] returns the [[CSS|Cascading Style Sheets]] value of one the colours in the current [[palette|ColourPalettes]]. -If no such entry exists in the current palette, the [[vanilla palette|$:/palettes/Vanilla]] is used instead. +If no such entry exists in the current palette, the [[vanilla palette|$:/palettes/Vanilla]] is used instead. If no such entry exists in the vanilla palette, the system looks for a configuration tiddler with the title `$:/config/DefaultColourMappings/` and transcludes the colour from the text field. This enables to plugins to ship defaults for colours that are not present in the core palettes. !! Parameters