On Tuesday, August 30, 2016 at 7:45:45 AM UTC+2, Mat wrote:
>
> Could this be used generically for any field? If one does want to style 
> using tags, or any other field? 
>

Not really. The attributes we are talking about here are DOM attributes, 
not tiddler fields. I did change the core ViewTemplate 
<https://github.com/Jermolene/TiddlyWiki5/blob/master/core/ui/ViewTemplate.tid>for
 
the test and used the "outer" <div> the holds the tiddler-frame. That's the 
same one, that uses the class="tc-tagged-xxxx". I just used the "attribute 
selector" CSS feature <http://caniuse.com/#feat=css-sel2>, that seems to be 
well supported by all browsers. So there should be no compatibility 
problem, if we use it.

Adding tiddler-field values to the DOM structure would be possible but I 
have no idea, what it does to TW performance. ATM I don't know, if the 
[attr] CSS feature is slow. ... So some more tests are needed.
 

> Also, this would also make it possible to, in each tiddler, have a 
> dedicated *style *field (just like currently there can be a *color *field) 
> for quick styling of a tiddler without a separate stylesheet. I.e directly 
> in the tiddler create a field with style: color:green; background:yellow;
>

Using the <style> element imo isn't a good idea, because it generally has 
one of the highest priorities. So it overwrites everything defined in theme 
style sheets. It should be the absolutely last possibility to style 
something and not the default. IMO it has the possibility to destroy themes 
and adds a lot of maintenance overhead. eg: once a <style> element is 
inserted in the DOM, it's close to impossible to change something with a 
standard class definition. The default should be class= and *may be *[attr]. 
But for the [attr] feature we'll need more tests.
 

> A style field would also make it possibly to style easily via actions (a 
> button); it is just to "set that field". Powerful!
>

Yea, powerful and imo toxic, if you want to design generic features or 
plugins. 

just some thoughts
mario

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/6db939be-4c14-479d-8fcf-54483b4a2803%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to