On Monday, June 27, 2022 at 11:12:46 PM UTC+2 Juan Palomo wrote:

> One more question. I have tried to modify the size of the icon since it is 
> larger than I want and I cannot find the parameter to adjust it.
> I have tried the following formula but it seems that it is not correct:
>
> @@fill:blue; width:1em; height: 1em; {{$:/core/images/tip}}@@



That doesn't work that way, since the height and width are directly defined 
in the SVG element. You need to do the following. 

Create 2 tiddlers eg: my-styles and my-macros

```
title: my-styles 
tags: $:/tags/Stylesheet
code-body: yes

.my-icon svg {
    height: 1em;
}
```

```
title: my-macros
tags: $:/tags/Macro
code-body: yes

\define my-icon(title) <span class="my-icon"><$transclude 
tiddler=<<__title__>>/></span> 
```

Call the macro with: `<<my-icon "$:/core/images/tip">>` ... That should do 
the trick. 

The first tiddler my-styles defines a CSS stylesheet, that allows you to 
define the hight of the SVG element. Since it keeps the aspect ratio, it 
will scale properly if you only change hight. 

The second tiddler defines a macro named: my-icon, that covers the SVG 
inside an HTML SPAN element and defines it's class="my-icon". Which allows 
the browser to assign the CSS stylesheet settings. 

I did add a little ZIP file that contains a JSON file, which can be drag & 
drop imported into a wiki. You can test it with tiddlywiki.com. It should 
work there since I did mace the macros with it. 

have fun!
mario


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/52846b77-69f7-44b3-8877-5a8af313dfc4n%40googlegroups.com.

<<attachment: svg-macro-call.zip>>

Reply via email to