Hi

On Thu, Feb 18, 2021 at 11:08 AM danraymond <[email protected]> wrote:

> Hi Mohammad
> I know this is an old post, but is it easy to make a status badge with
> three sections?
>

Yes! It is a simple css.



> I tried adding a new subclass and span but it didn't work. I added a new
> section to the stylesheet as well.
>

Check to see if you have the required css class defined.

>
> \define dbadge(subject, comment, status, type:"primary")
> <div class="dbadge"><span class="dbadge-subject">$subject$</span><span
> class="dbadge-comment">$comment$</span><span      class="dbadge-status
> dbadge-$type$ ">$status$</span></div>
> \end
>


to give a try open https://tiddlywiki.com/ and create a new tiddler with
the below wikitext

\define dbadge(subject, comment, status, type:"primary")
<div class="dbadge"><span class="dbadge-subject">$subject$</span><span
class="dbadge-comment">$comment$</span><span
class="dbadge-status">$status$</span></div>
\end


<<dbadge mysubject mycomment mystatus>>

<style>
.dbadge span{
border:1px solid black;
}
.primary{
background-color:cyan;
}

.dbadge-subject{
background-color:darkred;
color:white;

}

.dbadge-comment{
background-color:yellow;
}

.dbadge-status{
background-color:mistyrose;
}

</style>





>
> On Thursday, December 6, 2018 at 2:16:32 PM UTC+10 Mohammad wrote:
>
>> Hi Tony,
>>  Yes, I used a fixed color for subject part and I can remove it to let
>> you set the color as you like!
>> The other way is to use different colors for different categories.
>>
>> To do so, we need to modify the macro as below
>>
>>  \define dbadge(subject:"Subject",status:"Status",type1:"", type2:
>> "primary")
>> <div class="dbadge">
>>   <span class="$type1$">$subject$</span><span class="$type2$">$status$</
>> span>
>> </div>
>> \end
>>
>>
>> and remove line 8 in stylesheet.
>>
>> Now type2 is a css class to define your own background color.
>>
>>
>>
>> - Mohammad
>>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/5f5ae83c-840f-492b-9384-67795a640b5fn%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/5f5ae83c-840f-492b-9384-67795a640b5fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAAV1gMBpxy5mc87BGh%3DVpmCwssqe4ri2dMfKiFAuorhwwNU-EQ%40mail.gmail.com.

Reply via email to