<a class='tw-tiddlylink contact-icon' href='#My Tiddler'>The link</a>
<a class='tw-tiddlylink contact-icon' href='My Tiddler'>The link</a>
<a class='tw-tiddlylink tw-tiddlylink-resolves contact-icon' href='#My Tiddler'>The link</a>
<a class='tw-tiddlylink tw-tiddlylink-resolves contact-icon' href='My Tiddler'>The link</a>
- Retrieve the category tag by colour or less ideally by a static white list (there shouldn't be more than one, but if so, pick the first one).
- Fetch the associated icon of the chosen category tag (these are vector graphics from font-awesome).
- Apply it to the left of the link automatically when rendering without the need for the user to specify anything.
Scan the target tiddler tags.I understand that this might be trickier to implement, so I'm definitely not too fuss about it (i.e. more than happy to set the icons by hand).
<$set name="myclass" value={{!!class}}>
<span class=<<myclass>>><$link><$view field="title"/></$link></span>
</$set>
<span="value of the tiddler's class field"><a href="…">tiddler's title</a></span>
span.MyClass > a:before {
content: url(…);
}
{{myTargetTiddler||mylink}}
<span class={{!!class}}><$link><$view field="title"/></$link></span>
/* Missing links in red */
a.tw-tiddlylink-missing
{
color: #af0000;
}
/* All external links with the same icon */
a.tw-tiddlylink-external::before
{
content: "\f0eb"; /* Font Awesome icon: fa-lightbulb-o */
}
span.book > a:before
{
color: blue;
content: "\f02d"; /* Font Awesome icon: fa-book */
}
span.calendar > a:before
{
color: blue;
content: "\f073"; /* Font Awesome icon: fa-calendar */
}
/* [...] As needed */
<span class={{!!class}}><$link><$view field="title"/></$link></span>
Hi Danielo,
I don't see why this wouldn't work with other svgs or any other image format for that matter. As a quick related test, I tried with a normal image instead (a gif) and detected no problems:
CSS
span.archive> a
{
background: url("./images/Icon_Winzip.gif") center left no-repeat;
padding-left: 18px;
}
{{Zoology research - Mammals (2013)||mylink}}
Looks that you have quite experience with CSS. Thank you for taking the time to explain it to me.
I will put it in practice. Thank you!
Do you know if it will ever be possible to use tiddler images in a class?
Imo hardcoding base64 binary code for images in stylesheets has never been "my cup of tea"
Do you know if it will ever be possible to use tiddler images in a class?Just by transcluding them in the stylesheet.
The theme Tiddlers uses it
Do you know if it will ever be possible to use tiddler images in a class?Just by transcluding them in the stylesheet.
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.
.SomeClass{background: url(<<datauri "$:/core/images/home-button">>) center left no-repeat;padding-left: 18px;}
a:before {
content: url(<$macrocall $name="makedatauri" text={{$:/core/images/home-button}} type="image/svg+xml"/>)
}
I'm still not able to transclude any kind of image to the css.
I tried with a png image (embedded in base64) and with a svg image. No luck in any case. I set up the text to be tiddlywiki on the css.Can anyone explain how to create new buttons with svg or png images?
El domingo, 1 de junio de 2014 10:55:25 UTC+2, Jeremy Ruston escribió:The problem here is that the data URI technique will only work with full SVG images (ie tiddlers with the content type image/svg+xml, and that include a DOCTYPE). It won't work with image tiddlers that use embedded SVG elements; they don't actually define an independent image, but rather an inline image that can be transcluded. Have a look at the difference between the source of these two images:mailto:jeremy...@gmail.comOn Sun, Jun 1, 2014 at 6:34 AM, Stephan Hradek <stephan...@gmail.com> wrote:
I think ith has to be like this:
a:before {
content: url(<$macrocall $name="makedatauri" text={{$:/core/images/home-button}} type="image/svg+xml"/>)
}
It works partly. When I inspect a link using Firebug, I see the content url. But nothing is displayed.--
Jeremy Ruston
There are many svg examples, that's right but they are not very real world examples. Any svg you can find anywhere have thousand of extra fields and parameters. How can we adapt those images?
That's what I'm talking about.
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.
/* For tiddlers with names containing "Note -" as part of their title. */
a[href*='Note%20-']
{
background: url("./images/category_note.png") center left no-repeat;
padding-left: 20px;
}
/* For tiddlers with names containing "Article -" as part of their title. */
a[href*='Article%20-']
{
background: url("./images/category_article.png") center left no-repeat;
padding-left: 20px;
}
/* For tiddlers with names containing "Idea -" as part of their title. */
a[href*='Idea%20-']
{
background: url("./images/category_idea.png") center left no-repeat;
padding-left: 20px;
}
Cheers,
Frederico