[Concept] Aggregated stylesheets

168 views
Skip to first unread message

Mat

unread,
Jan 4, 2016, 2:13:52 PM1/4/16
to TiddlyWiki
Considering how transclusions are a main feature in TW, I find it surprising how we give Stylesheets the role they have. There is value in centralization and Stylesheets have come about, I assume, because it is convenient to have it all gathered in one place. But there is also value in the immediate access that you get from putting styles where they are used.

...So, can we not "simply" get the best from both worlds by using transclusion or some other TW mechanism to put "styles snippets" locally and merely aggreate them into a central SS?

And I think that if we use the ViewFields idea and aggregated all such "style fields" into a SS we'd be able to edit it in both places.

Am I missing reasons to have central stylesheets?

<:-)

Jed Carty

unread,
Jan 4, 2016, 2:42:21 PM1/4/16
to TiddlyWiki
The stylesheets used for my icon menus are dynamically built from fields in different tiddlers, but probably not to the extent that you are considering. There is no reason this couldn't be expanded upon. The biggest reason I know of to have a central sylesheet is to have a central listing. What are you thinking about for 'styles snippets'? I am not sure how we would put them inside other tiddlers but it would be relatively easy to have a style listing field in a tiddler and the names of the used classes in that field (the new action-listops widget makes this much easier to do), then use something like your ViewFields idea to display it either in view or edit mode. If you built the css classes like in my experiments here than you could use the ViewFields to edit them from any tiddler that lists that class in its style listing field or from a central listing.

I think that is following your idea anyway. For people who want to use a wiki with lots of styling this could be a very useful addition. And it may let us get closer to the being able to click on an object and directly edit its style in the wiki, which would be a great way to make themes.

Tobias Beer

unread,
Jan 4, 2016, 2:53:14 PM1/4/16
to TiddlyWiki
hi Mat,

From a design perspective, it is not at all a great idea to mingle Model View and Controler into one.
The more you do that, the more you'll end up with a big mess.

Best wishes,

Tobias. 

PMario

unread,
Jan 5, 2016, 6:01:57 AM1/5/16
to TiddlyWiki
On Monday, January 4, 2016 at 8:13:52 PM UTC+1, Mat wrote:
Am I missing reasons to have central stylesheets?

The idea of a central CSS is, that you should not mix content with styling. ... What would happen, if users start adding CSS rules to the following content?

see: http://www.csszengarden.com

It would be a big mess and contradict the CSS mechanism at all.

-mario

Mat

unread,
Jan 6, 2016, 11:12:14 AM1/6/16
to tiddl...@googlegroups.com
I really wanted to have a demo before I came back to this thread so to clarify what I envision - and now I have :-)

Here is Aggregated Stylesheet


@Jed, sorry for my belated response to your kind reply! I have actually looked at your Style Manager (hey! that's a really good term for it!) previously and I think it has HUGE potential. (Please pick up on it again!)

You mention a "action-listops widget" where can I find this actually?


> And it may let us get closer to the being able to click on an object and directly edit its style in the wiki, which would be a great way to make themes.

Interesting! maybe one could access the style by clickign on the object (as you just said) and then when you edit the style, you're really creating a new stylesheet. Or adding to a global custom such. So that it gradually grows into a theme. Super cool idea and it certainly sounds doable!

I wonder how "radically" such stylesheets could deviate from the current though. That link from @Mario was... VERY WOW (thanks @Mario!!!) - but I doubt TW could allow this variation with radical repositionings considering that things are rather carefully positioned to be accessible in the TW UI (right?)


Regrding my demo on Aggregated Stylesheets, I'd love to hear your (everyones) thoughts. In my view we are already breaking the idea with one central SS because TW allows tiddler-specific styles, which of course is very desirable for plugin makers, themes etc. As you'll see in my demo, the idea is to collect such dispersed stylesheets into a central one where they (1) get a common $:/tags/Stylesheet tag (to make them global) and (2) to make them "centrally and directly editable".

<:-)

P.S I'll unfortunately be tied with other tasks for some days now (as part of my education to learn to code for real... wohoo!)

P.S2 - also, thank you @Tobias for your reply of course :-)

Zaphod Beeblebrox

unread,
Jul 15, 2016, 1:58:21 PM7/15/16
to TiddlyWiki
So has anyone delved further into this idea?

I agree that the 'modular' style of discrete tiddlers does naturally lead to the idea of aggregation of style elements.

I would love to see such an implementation incorporated into the core of TW, whereby we would be able to style more individual parts of the wiki.

This also leads me back to something I've been searching for (in vain): a (complete, exhaustive?) listing of all the parts that make up the interface; the tiddler, the SideBar, etc.  Maybe a presentation showing the elements with their CSS names (.tc-tiddler-whatever) with different color backgrounds for each element so they can be easily separated and identified.  This in itself would make the task of creating more varied designs and maybe even Themes that much easier.

--Zaphod

Mark S.

unread,
Jul 15, 2016, 2:10:25 PM7/15/16
to TiddlyWiki

You probably already know this, but if you are in Firefox (and Chrome, I think) you can right click on a piece of text and choose "inspect element". Then a little console will open up below allowing you to work out the current classes of the selected object.

There's a nice little image of styles in TW that someone has posted somewhere. Wish I had kept the URL. Maybe someone will come forward?

Mark

Zaphod Beeblebrox

unread,
Jul 16, 2016, 9:41:02 AM7/16/16
to TiddlyWiki
Thank You for the suggestion, Mark :)

Yes, I'm fairly familiar with the Developer's Console in both Firefox and Chrome, I'm just not very proficient at using it :-P

I was hoping someone had done a 'demonstration' type thing somewhere that I could readily access to see all the different parts that make up the interface.

I'll keep plugging away until I figure it out :)

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