CSS for last char of tiddler title?

136 views
Skip to first unread message

Robert Barker

unread,
Oct 13, 2018, 11:00:29 PM10/13/18
to TiddlyWiki
Amateur here, wondering if someone has a hint for me regarding CSS styling of a tagged tiddler?

The desired outcome is for the last character of a Tiddler title display in a different color, and preferably bold. More specifically, a red period appended to the end of certain tiddlers (period can simply be shown/added as suffix, not necessarily included in typed title). No other character is necessary - simply a style that is used across other formatted non-wiki documents: i.e. Markdown/Microsoft Office.

Thanks for any consideration.  This is simply a formatting request stemming from trying to match a styled document set, not the end of the world.


Example:  (i,e, Tiddler tagged: "Period")

Tiddler Title. --> Tiddler Title.   (period typed in title)

or

Tiddler Title --> Tiddler Title. (period appended or displayed only)

Mat

unread,
Oct 14, 2018, 5:37:33 AM10/14/18
to TiddlyWiki
title: whateveryouwant
tags
: $:/tags/Stylesheet
text
:
[data-tags*="Period"] .tc-title:after {
  content
:"xxxxxxxxxxx";
  color
:red;
}

<:-)

Robert Barker

unread,
Oct 14, 2018, 8:01:26 AM10/14/18
to tiddl...@googlegroups.com
EDIT: It works now, heh...re-entered it using your and some other examples.

[data-tags*="Period"] .tc-title:after{
  content: ".";
    color: red;

Thank you again!

----
Thanks for the reply.  For some reason, title style changes do not seem to apply regardless of standard change like text color or {after} , only had luck with general stuff without tc.title like background on whole tiddler or having styled "Content" appended to the tiddler itself.
This is on a blank copy from editions v5.1.17.

TonyM

unread,
Oct 14, 2018, 6:32:26 PM10/14/18
to TiddlyWiki
Robert,

Nice work on Mats's behalf here using the new class features. I would have answered but Mat had done so, I used this this the past in TWC and thought I would just open up some related ideas.

I used this method in the past to indicate Questions, Answers and assertions and exclamations on tiddlers without altering the tiddler name, although I think it is important to be able to toggle this on or off, in TW5, perhaps adding and removing the $:/tags/Stylesheet tag from the cutom stylesheet.

The title had the suffix as follows
  • Question ?
  • Answer ?! (A question with an assertion)
  • Exclamation ! (A statement of believed fact, an answer that had no question)
  • An assertion to Question !? (A statement I believe to be true but needs a little more confirmation)
Of course the above was driven by tagging which allowed one to action or search for Questions/Answers. The advantage here is no need to change the tiddler title when the Question is answered, Just change the tags and it is displayed differently.

In TW5 I also used a custom class so that inside tiddlers I could indicate Questions and answers with colour highlighting as follows

;.q The Question here
:.a The answer here

Defining in a style-sheet the q and a classes.

And subsequently I found a method to count the ";.q" and ":.a" strings in a tiddler indicating how many Q&A pairs existed in the tiddler, and or how many questions were still "unanswered".

Regards
Tony

Mohammad

unread,
Oct 14, 2018, 11:52:39 PM10/14/18
to TiddlyWiki
I would suggest using
[data-tags~="Period"]




instead of

[data-tags*="Period"]


Magnus

unread,
Oct 16, 2018, 6:37:29 PM10/16/18
to TiddlyWiki
Please, could you explain the differens for a noob like me, still trying to learn TW

Mohammad

unread,
Oct 16, 2018, 11:32:47 PM10/16/18
to TiddlyWiki
Magnus,
 The answer is here:

Cheers
Mohammad
Reply all
Reply to author
Forward
0 new messages