[2.0][bloctheme] ModernStyle v1.0.3

Started by Bloc, March 28, 2016, 08:18:22 AM

Previous topic - Next topic

Antechinus

Quote from: lurkalot on April 01, 2016, 01:13:17 PMThe next release of TP won't have tables. It's having a long overdue revamp in that department. ;)

Good move. Hey suggestion: move the markup for the panel upshrinks out of Sources and into one of the templates. Much more versatile for custom layouts.

Come to think of it, block upshrinks too. This was one of the advantages of the old 0.9.8 setup. I was able to make it touchscreen and phone friendly without needing to hack Sources, simply by adding some portal templates to custom themes and tweaking them.

Bloc

Quote from: Antechinus on April 01, 2016, 05:14:40 PM
Quote from: lurkalot on April 01, 2016, 01:13:17 PMThe next release of TP won't have tables. It's having a long overdue revamp in that department. ;)

Good move. Hey suggestion: move the markup for the panel upshrinks out of Sources and into one of the templates. Much more versatile for custom layouts.

Come to think of it, block upshrinks too. This was one of the advantages of the old 0.9.8 setup. I was able to make it touchscreen and phone friendly without needing to hack Sources, simply by adding some portal templates to custom themes and tweaking them.

Actually..you can change the upshrinks for blocks and panels by changing the templates. It means replacing the calls and provide new js for the new calls, but look at my TP templates in ModernStyle for clues - if you like to try that. :)

Antechinus

Yeah I'm sure by rewriting enough stuff you could do that, but it'd still be handy if it had them in the templates to start with.

Antes

We don't need table elements anymore we can use CSS to handle it which also helps greatly with responsiveness. You can take a peek at ezPortal or PortaMX (GitHub version).

Biology Forums

I still don't see the problem with table layouts. They are as versatile as dividers in block form. Also, with pseudo elements, things can be hidden, rearranged, etc.

Antechinus

@Antes: we weren't talking about tables any more. ;) And I'm well aware we don't need them.

Quote from: Antechinus on April 01, 2016, 07:21:44 AMI had TP 0.9.8 running without tables years ago.

@Shuban: no, tables are not as versatile. They're not too bad, but not as flexible as some other options. The other problem with them is that they are bad for people on screen readers, unless you are only using them for purely tabular data (ie: one item only per cell). Trying to sort out table-based layout for a gui on a screen reader can be a real PITA, because none of it makes sense that way.

Biology Forums


Bloc

Using display: table/table-cell goes along way in providing a similar table-like experience as real rables - but with all the benefits of being able to change it when needed.

Although you can get even table cells to line up vertically by setting display: block on them. AFAIK they will be a bit unpredictable...and in any case, as Antechinus mentions, its not semantically correct for screen readers anyway.

Antechinus

Didn't know you could get td's to stack vertically that way. Hadn't ever thought of trying it. I can see it being "unpredictable". :D

I have used absolute positioning on them before, and that can be handy for some things. For example, I've used it to haul td's out of portal templates and stick them where I want them.

Bloc


Antechinus

By the way, a little trick I thought of yesterday. Could be fun to use in a theme variant sometime.

http://www.elkarte.net/community/index.php?topic=3448.0

Antechinus

Quote from: Bloc on April 02, 2016, 06:22:35 PM
It is..but proof of concept: http://jsfiddle.net/vczd5wox/1/

Interesting. I'll play around with it later, just to see what disasters I can create. :D

Bloc

Quote from: Antechinus on April 02, 2016, 06:23:26 PM
By the way, a little trick I thought of yesterday. Could be fun to use in a theme variant sometime.

http://www.elkarte.net/community/index.php?topic=3448.0
Yes, def. :) But would not the fixed top-padding limit things when you adjust the width of the browser? If the theme is fluid width of course.

Bloc

..to quite another point(as I am working with styling with the bbc_table styling in ModernStyle), would it be too sumptuous to make any first row in a table inside a post automatically "headers"?

I am styling all bbc_tables zebrastriped, and using "tr:nth-child(1) td" to style the very first row a typical header style instead. But if the table only has one row, I take it away again by using "tr: only-child", so the one-row table do not have any header styles. But I am unsure if forcing headers are wise - even if it looks very cool lol. :)

Biology Forums

Hey Bloc, you should offset the board anchor links by -50px or so on boardindex. On mobile, for example, clicking the anchor pushes you beyond the starting point due to the trailing header.

Antechinus

Quote from: Bloc on April 02, 2016, 06:34:24 PM
Quote from: Antechinus on April 02, 2016, 06:23:26 PM
By the way, a little trick I thought of yesterday. Could be fun to use in a theme variant sometime.

http://www.elkarte.net/community/index.php?topic=3448.0
Yes, def. :) But would not the fixed top-padding limit things when you adjust the width of the browser? If the theme is fluid width of course.

So you can use media queries to change the padding.


Quote from: Bloc on April 02, 2016, 06:41:59 PM
..to quite another point(as I am working with styling with the bbc_table styling in ModernStyle), would it be too sumptuous to make any first row in a table inside a post automatically "headers"?

I am styling all bbc_tables zebrastriped, and using "tr:nth-child(1) td" to style the very first row a typical header style instead. But if the table only has one row, I take it away again by using "tr: only-child", so the one-row table do not have any header styles. But I am unsure if forcing headers are wise - even if it looks very cool lol. :)

Is it actually header content as such (albeit in a td rather than a th) or just standard cell data styled to look like a header? If the former, then sure. If it's just standard cell data then header styling seems a bit odd to me.

Bloc

Well, thats the thing..its not explicit header data, because afaik the bbc table  tag don't have a "header" part..or do they? So everything is normal data-cells. But by styling it such, it might encourage users to actually use the first td's for headers.

Maybe I should make it a theme setting whether it does this styling or not.

Quote from: Shuban on April 02, 2016, 09:13:42 PM
Hey Bloc, you should offset the board anchor links by -50px or so on boardindex. On mobile, for example, clicking the anchor pushes you beyond the starting point due to the trailing header.

Thanks, looking into it now.

Antechinus

Oh ok, I missed the bit where you said it was for the bbc tag. I was just thinking of general tables. I suppose you could always mod the tag to use th's as well, but that's probably overkill.

Bloc

Nah, I don't want to mod them. But I think I will add a theme-option for it, so people can choose. Normal BBC tables are not styled normally, but it would make a great change to actually have a nice styled table out of it. Attached is a screenshot.

Biology Forums

How often are tables used in posts though. I wouldn't invest energy into it, tbh.

Advertisement: