TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
7.97k stars 1.18k forks source link

default styles for td, tr, th #2018

Open tobibeer opened 8 years ago

tobibeer commented 8 years ago

In tb5, I define the default vertical alignment for table cells as...

tr, td, th {
vertical-align:top;
}

Is there / what is the appropriate place to define default styles for all themes?

An example for the problem with the default:

center

With the proposed change...

top

Jermolene commented 8 years ago

Hi @tobibeer I think this would be rather a backwards incompatible change.

Instead, perhaps we should introduce a few useful, core CSS classes for standard core table styles to cover common use cases?

tobibeer commented 8 years ago

I think this would be rather a backwards incompatible change.

Not sure people do (or should) heavily rely on vertical align in tables (for layouting purposes)... but yes, it's possible. What I see mostly — when I see it — is the problematic behavior. So, a default change would probably fix more problems than it introduces.

Instead, perhaps we should introduce a few useful, core CSS classes for standard core table styles to cover common use cases?

Sure. How about table.tc-top? Perhaps another also table.tc-borderless?

Jermolene commented 8 years ago

Sure. How about table.tc-top? Perhaps another also table.tc-borderless?

I'm not sure it's worth a class just to encapsulation the top alignment. I was thinking of higher level classes, kind of like the choices one gets in PowerPoint. But combinations of classes could also work I guess.

tobibeer commented 8 years ago

I was thinking of higher level classes, kind of like the choices one gets in PowerPoint.

Yes, not necessarily just bound to table cells, of course. Just wanted to indicate that we'd have to be specific to cover certain table elements.

How about a subset of Eric's StyleSheetShortcuts?

Jermolene commented 8 years ago

How about a subset of Eric's StyleSheetShortcuts?

That's certainly one approach, and has the advantage of being tried and trusted. I had a look for open source libraries of different table themes, but could find anything. Most of the CSS frameworks that I looked at just support a single table style.

tobibeer commented 8 years ago

To be clear, we're just aiming at often used important defaults here. Right?

pmario commented 8 years ago

IMO TW (base and vanilla) should have an absolute minimum set of CSS default rules.

Something like StyleSheetShortcuts should be a plugin, theme or palette. Wherever it fits best.

tobibeer commented 8 years ago

Something like StyleSheetShortcuts should be a plugin, theme or palette. Wherever it fits best.

Surely neither a theme nor a palette. It could be wrapped up as a plugin, but then I'm not sure it's worth it. It appears to be rather a simple StyleSheet that is available independent / on top of any plugins, themes or palettes.

I'm not sure its purpose is to make amends for / overwrite otherwise problematic defaults like in the OP. I think "fixing" or changing those is independent from a simple css tiddler with meaningful base-classes.

So the options for #2018 seem:

pmario commented 8 years ago

Yes. Table defaults as in the OP should be part of "base" or "vanilla" CSS