Adjust color if tiddler has tag

91 views
Skip to first unread message

vinvi...@gmail.com

unread,
Jan 10, 2021, 5:33:22 AM1/10/21
to TiddlyWiki
Hello,

(Shiraz plugin)

<$macrocall $name="details" sum="{{||$:/plugins/kookma/favorites/viewtoolbar}} {{||$:/core/ui/TagTemplate}}" src="""
Text here
""" status="closed" style="background-color: #; color:aqua;" class="alert-success"/>


I want to have the color ( color:aqua; ) automatically adjusted if the tiddler has one of the following tags; (Or if a field contains one of the following values.)

Cold = blue
Cool = aqua
Neutral = white
Warm = orange
Hot = red

Thank you,

vinvi...@gmail.com

unread,
Jan 10, 2021, 10:22:11 AM1/10/21
to TiddlyWiki
I have found this:
How to apply custom styles by tag :  https://tiddlywiki.com/static/How%2520to%2520apply%2520custom%2520styles.html 

but it says it is deprecated... 

Op zondag 10 januari 2021 om 11:33:22 UTC+1 schreef vinvi...@gmail.com:

PMario

unread,
Jan 10, 2021, 11:13:46 AM1/10/21
to TiddlyWiki

vinvi...@gmail.com

unread,
Jan 11, 2021, 5:47:20 AM1/11/21
to TiddlyWiki
How do I do this?

1 Can I refer to a CSS style sheet in the code below?

<$macrocall $name="details" sum="{{||$:/plugins/kookma/favorites/viewtoolbar}} {{||$:/core/ui/TagTemplate}}" src="""
Text here
""" status="closed" style="background-color: #; color:aqua;" class="alert-success"/>

2 Or do I have to make changes to the plugin code?

tag: $:/tags/Macro
title: $:/plugins/kookma/shiraz/macros/details   --->

\define details(sum:"summary", src:"source", status:"", class:"", style:"")
<details $status$>
 <summary style="$style$">$sum$</summary>
  <div class="$class$">
   $src$
  </div>
</details>
\end 

3 And how do I do that in the "right" way?








Op zondag 10 januari 2021 om 17:13:46 UTC+1 schreef PMario:

vinvi...@gmail.com

unread,
Jan 11, 2021, 9:45:22 AM1/11/21
to TiddlyWiki
Sorry, forgot to include the stylesheets,




Tag: $:/tags/Stylesheet
Title: $:/plugins/.mr/shiraz/stylesheet/details

/*details html5 macro*/
details > summary {
  padding: 2px 6px;
  background-color: #efebe9;
  font-weight:500;
  outline:none;
}
details > div {
  background-color: #fffef9;
  padding: 2px 6px;
  margin: 0;
}


----


Tag: $:/tags/Stylesheet
Title: $:/plugins/kookma/shiraz/styles/details-slider 

/*details html5 macro*/
details > summary {
  padding: 2px 6px;
  font-weight:500;
  outline:none;
}
details > div {
  padding: 2px 6px;
  margin: 0;
}

button .kk-sh-slider svg{
width: 0.8em;
height: 0.8em;
vertical-align: middle;}

 

Op maandag 11 januari 2021 om 11:47:20 UTC+1 schreef vinvi...@gmail.com:
Reply all
Reply to author
Forward
0 new messages