Access ul depth?

39 views
Skip to first unread message

Mat

unread,
Aug 8, 2019, 9:28:52 AM8/8/19
to TiddlyWikiDev
This bullet list...

@@.mystyle
* foo
*** bar
@@

...has a depth of three.

I would like to access this number in .mystyle to use it to style the width of the whole ul e.g in css width:calc(ULDEPTH * 20px)

In css3, styles cannot be applied to a parent node based on the number of children it has. It does seem possible with js.

How could this be done in TW?

<:-)

Mat

unread,
Aug 8, 2019, 10:43:09 AM8/8/19
to TiddlyWikiDev
Additional js sources. The problem is of course to get it into TW and so the "variable" can be accessed.

<:-)

Mohammad

unread,
Aug 8, 2019, 1:48:58 PM8/8/19
to TiddlyWikiDev
I support your idea!
It worth to access such property from inside TW without JS!
Handling dynamic CSS using TW script is a great feature but very restricted as we have no access to such properties!
For example in Timelines plugin I needed to calculate the width of a parent element!

--Mohammad
Reply all
Reply to author
Forward
0 new messages