How to set tag colors for ListReveal ?

65 views
Skip to first unread message

Mark S.

unread,
Sep 18, 2019, 12:14:31 AM9/18/19
to TiddlyWiki

I would like to import a large language dictionary into TW. I was thinking that for the interface
I might use listreveal, since it looks more professional than anything I would come up with:


The problem is that the tags for individual revealed items are almost invisible. (white lettering on gray background).

I tried tracking down where the styles were coming from, but it seemed to be part of the standard theme. On the listreveal
page, a completely different theme is being used. But I would rather stick with the standard theme for this project.

How can I set the CSS and/or styles to make the tags visible?

Thanks!

Thomas Elmiger

unread,
Sep 18, 2019, 1:57:48 AM9/18/19
to TiddlyWiki
Hi Mark,

It seems, that I implemented a muted tag design as a feature. Below you find the muted class defined in
<<lrBtnTags muted>>

I do not remember where this style could be changed in the complicated system of tag construction in TW (and I am on the phone).

But you could try to remove the word muted in your own copy of $:/plugins/telmiger/listreveal/tags

Good luck!
Thomas


\define lrBtnTags(class:"")
<span class="lr-flex-wrapper">
<$wikify name="tiddler" text=<<currentTiddler>>>
<$macrocall $name="lrBtnAddTags" tiddler=<<tiddler>> class="""$class$"""/>
<$macrocall $name="lrTagsPopup" tiddler=<<tiddler>>/>
</$wikify>
</span>
\end

\define listreveal-tags(exclude:"")
<$vars exclude="""$exclude$""">
<span class="listreveal-tags te-flex-item">
<<lrBtnTags muted>>
<span class="te-tags">
<div class="tc-tags-listreveal"><$list filter="[all[current]tags[]sort[title]]" storyview="pop" template="$:/plugins/telmiger/listreveal/templates/tag"/>
</div>
</span>
</span>
</$vars>
\end

Mark S.

unread,
Sep 18, 2019, 11:59:56 AM9/18/19
to TiddlyWiki
That didn't seem to work. ToDoNow doesn't have this problem. It shows a black text instead of a white text on top
of a gray tag background. I wonder if I just used the older listreveal from todonow if it would work better?

Thanks!

Mark S.

unread,
Sep 18, 2019, 3:20:00 PM9/18/19
to TiddlyWiki
listreveal seems to want to get the tag color from

sidebar-tab-foreground-selected

in the vanilla palette. But that color isn't defined in the vanilla palette, that I can tell. There's an empty space where it should be.

what gets generated instead, when I inspect the tag element, is

color: 244,244,244,1

This creates an error (warning icon) in the element inspector.

I'm guessing that TW was trying to make a default of rgba(244,244,244,1) but somehow leaves off the "rgba" part.

The same thing happens with the background color. So both have 244,244,244,1 which doesn't do anything. The little
bit of white and gray color must be coming from somewhere else in the cascade.

So I can fix it for my purposes by tweaking the vanilla theme:

sidebar-tab-foreground-selected: green

And probably a similar thing for the background.

It might be worth noting though, that these palette entries aren't always defined.

Thanks!

Thomas Elmiger

unread,
Sep 18, 2019, 4:09:13 PM9/18/19
to TiddlyWiki
Honestly, I never understood, why in $:/core/macros/tag the tagpill colours are defined as hardcoded element styles. I think CSS would make it much more hackable.

And I also never understood, how the core's contrastcolour macro, that is involved there, works or should work and if it really does what it should under all circumstances. E.g. it might be the rgba(...) part is missing here:

		// If neither colour is readable, return a crude inverse of the target
		return [255 - rgbTarget[0],255 - rgbTarget[1],255 - rgbTarget[2],rgbTarget[3]];

But I am happy to see that you found a workaround as well as that listreveal at least works with several of the palettes included in TW 5.1.21.

Thanks for trying listreveal anyway :)
Reply all
Reply to author
Forward
0 new messages