wikilabs / plugins

TW5 plugins: https://wikilabs.github.io
30 stars 8 forks source link

Uni-link inconsistent link styling #125

Open ShadowHornet opened 2 years ago

ShadowHornet commented 2 years ago

Testing on uni-link 2.2.0.

The uni-link plugin displays inconsistent behaviour regarding the tc-tiddlylink and tc-tiddlylink-missing styles.

For links with alternate names, like [[alternate name|tiddler name]], uni-link uses the tc-tiddlylink and tc-tiddlylink-missing styles accordingly, for both existing and missing tiddlers.

For direct links, like [[tiddler name]], uni-link overrides the tc-tiddlylink and tc-tiddlylink-missing styles with the uni-link style for both existing and missing tiddlers.

Would it be possible to change the uni-link plugin behaviour, using the special styles only for the aliases use case, and keeping the default styles for the regular links?

pmario commented 2 years ago

The uni-link plugin displays inconsistent behaviour regarding the tc-tiddlylink and tc-tiddlylink-missing styles.

If you go to tiddlywiki.com you will see the same behaviour. tc-tiddlylink is the class every link gets. No matter if it exists or if it doesn't

tc-tiddlylink-missing and tc-tiddlylink-resolves are the 2 classes that show missing or existing.

... For the other behaviour I'll have to have a closer look

pmario commented 2 years ago

have a look at: https://wikilabs.github.io/editions/uni-link/#%24%3A%2Fplugins%2Fwikilabs%2Funi-link%2Fstyles If you open the tiddler and remove the tag, you get the default behaviour back for everything.

If you keep the tag, you can remove the uni-link related rules and only keep the alias related rules. That should do the trick.

ShadowHornet commented 2 years ago

Hi! Thanks for you quick feedback! Since I haven't heard about tc-tiddlylink-resolves before, I went through some tests at tiddlywiki.com, but it don't see the point anyway, since it overrides tc-tiddlylink. On the other hand, I find tc-tiddlylink-missing really usefull, hence my concern with the uni-link behaviour I described, which is definitely not the default behaviour.

ShadowHornet commented 2 years ago

have a look at: https://wikilabs.github.io/editions/uni-link/#%24%3A%2Fplugins%2Fwikilabs%2Funi-link%2Fstyles If you open the tiddler and remove the tag, you get the default behaviour back for everything.

If you keep the tag, you can remove the uni-link related rules and only keep the alias related rules. That should do the trick.

Yesterday I spent a couple hours through all uni-link plugin components, and $:/plugins/wikilabs/uni-link/styles was the very first. It took me this much to realize that simply cleaning up the uni-link style would yield the result I wanted. It was just too late to amend my post here, sorry for that!

Thanks for the help, anyway!

pmario commented 2 years ago

hi, if the issue is resolved, please close it.

pmario commented 2 years ago

At the landing page, there is a header: Link Styling ... It obviously wasn't enough info ...

What should be improved, so others could avoid the problem you had. Feedback would be very welcome.

pmario commented 2 years ago

Since I haven't heard about tc-tiddlylink-resolves before, I went through some tests at tiddlywiki.com, but it don't see the point anyway, since it overrides tc-tiddlylink.

Not necessarily. tc-tiddlylink is used many times in the base stylesheet. tc-tiddlylink-missing ... only sets font-style: italic but leaves the other settings unchanged. .. That's the advantage of the C-Cascade in CSS

tc-tiddlylink-resolves .. used 2 times and sets font-weight: normal

There are some more: tc-tiddlylink-shadow and tc-tiddlylink-external which also use tc-tiddlylink as their base and only change the "deltas"

ShadowHornet commented 1 year ago

Hi Mario, I've got distracted by other tech the last couple of weeks, but only will be able to resume this later this month. I don't recall the circumstance right now and don't have the time to review, but obviously the styling info was not enough to save me some 4 hours of troubleshooting in the occasion, as I also missed some information about Tiddlywiki itself. Thanks for your support, anyway. Best regards!