mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-30 05:19:57 +00:00
Rewrite colour macro as a function
Using the new wikify operator. Currently has a bug whereby redirected colours (like "tiddler-background") do not work. Direct colours like "background" do work. Note the hacks needed to makeFakeWidgetWithVariables work
This commit is contained in:
parent
467a1a47cc
commit
a23ee165d8
@ -341,7 +341,11 @@ Widget.prototype.makeFakeWidgetWithVariables = function(variables) {
|
|||||||
},
|
},
|
||||||
makeFakeWidgetWithVariables: self.makeFakeWidgetWithVariables,
|
makeFakeWidgetWithVariables: self.makeFakeWidgetWithVariables,
|
||||||
resolveVariableParameters: self.resolveVariableParameters,
|
resolveVariableParameters: self.resolveVariableParameters,
|
||||||
wiki: self.wiki
|
wiki: self.wiki,
|
||||||
|
variables: variables,
|
||||||
|
getAncestorCount: function() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,16 +2,13 @@ title: $:/core/macros/CSS
|
|||||||
tags: $:/tags/Macro $:/tags/Global
|
tags: $:/tags/Macro $:/tags/Global
|
||||||
|
|
||||||
<!-- Needs to stay that way for backwards compatibility. See GH issue: #8326 -->
|
<!-- Needs to stay that way for backwards compatibility. See GH issue: #8326 -->
|
||||||
\define colour(name)
|
\function colour(name)
|
||||||
\whitespace trim
|
[{$:/palette}getindex<name>] :else[{$:/palettes/Vanilla}getindex<name>] :else[[$:/config/DefaultColourMappings/]addsuffix<name>get[text]] :and[wikify[text],[inline]]
|
||||||
<$transclude tiddler={{$:/palette}} index="$name$">
|
\end colour
|
||||||
<$transclude tiddler="$:/palettes/Vanilla" index="$name$">
|
|
||||||
<$transclude tiddler="$:/config/DefaultColourMappings/$name$"/>
|
|
||||||
</$transclude>
|
|
||||||
</$transclude>
|
|
||||||
\end
|
|
||||||
|
|
||||||
\define color(name) <<colour $name$>>
|
\function color(name)
|
||||||
|
[function[colour],<name>]
|
||||||
|
\end function
|
||||||
|
|
||||||
\function box-shadow(shadow)
|
\function box-shadow(shadow)
|
||||||
[[ -webkit-box-shadow: $(shadow)$;
|
[[ -webkit-box-shadow: $(shadow)$;
|
||||||
|
Loading…
Reference in New Issue
Block a user