mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-28 16:23:15 +00:00
Enhance colour macro with a fallback to a configuration tiddler
This commit is contained in:
parent
46159bd061
commit
4afde5a722
|
@ -2,7 +2,7 @@ title: $:/core/macros/CSS
|
||||||
tags: $:/tags/Macro
|
tags: $:/tags/Macro
|
||||||
|
|
||||||
\define colour(name)
|
\define colour(name)
|
||||||
<$transclude tiddler={{$:/palette}} index="$name$"><$transclude tiddler="$:/palettes/Vanilla" index="$name$"/></$transclude>
|
<$transclude tiddler={{$:/palette}} index="$name$"><$transclude tiddler="$:/palettes/Vanilla" index="$name$"><$transclude tiddler="$:/config/DefaultColourMappings/$name$"/></$transclude></$transclude>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define color(name)
|
\define color(name)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
created: 20150221154058000
|
created: 20150221154058000
|
||||||
modified: 20150221154522000
|
modified: 20200228142855357
|
||||||
tags: Macros [[Core Macros]]
|
tags: Macros [[Core Macros]]
|
||||||
title: colour Macro
|
title: colour Macro
|
||||||
type: text/vnd.tiddlywiki
|
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]].
|
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/<colour-name>` 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
|
!! Parameters
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user