-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC Mobile Tables #508
base: main
Are you sure you want to change the base?
RFC Mobile Tables #508
Conversation
Signed-off-by: brian teeman <brian@teeman.net>
Forgot to add. As well as the ease of implementation the other main benefit is that you no longer have to remember what the data is in each column or keep scrolling up and down to the header |
This is great, just a bit premature – it's okay, you can't read my mind. Right now, all pages use server-side rendering. This is a problem when we have repetitive markup and strings, like we do in tables, and even more so in a mobile stack. We end up with a very lengthy HTML document. I want to reduce the size of the data transferred from server to client to better support mobile devices which tend to be worse in terms of bandwidth, roundtrip time, and dropped packages compared to desktop. I would like to follow this approach after I introduce Petite Vue on that page. Going from server-side to client-side rendering would allow us to both reduce the initial document transferred over the wire (a very small HTML file with an embedded JSON document where all various bits and pieces are loaded from), and allow us to update parts of the page dynamically which is something we cannot currently do. Since that would be making the page mobile-friendly, I think it would also be a great choice for introducing a mobile stack in it as well. So, please leave this open until I get to that. |
Are you sure about that? |
Look, my mind-reading expectations are set very high by Crystal. You can get quite close, but not at that level 🤣 |
If it hadn't been for SCSS, I would have gladly taken care of the CSS myself. |
@morphinestyle SCSS isn't all that scary. Most of what they are doing there, and the way we're using it, is going to be part of the CSS specification itself. .foo {
&:hover { color: fuchsia; }
span { color: red; }
} becomes .foo:hover { color: fuchsia; }
.foo span { color: red; } That's pretty much it. It's a more… cascading way to write cascading style sheets :) |
Making all the tables "mobile friendly" is a real pia - especially if you want to maintain accessibility. I've seen you jump through all sort of loops to even try to make it work. Adding lots of additional classes and even additional markup for mobile only.
Instead of that I would like to propose a much simpler option which I am calling "is-stacked-mobile". This is a CSS only solution that requires very minimal extra markup to convert a table row into a stack when mobile.
Example Screenshots
Before
After
Howto
This draft pr contains an example for the extensions table in the screenshots above. As you can see it introduces some extra scss and then just 4 easy edits on a table. Thats it. Of course you can still do d-sm-none etc if needed as well.