mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-11-04 09:33:00 +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:
		@@ -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)$;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user