Skip to content
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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

brianteeman
Copy link
Collaborator

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

image

image

After

image

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.

Signed-off-by: brian teeman <[email protected]>
Signed-off-by: brian teeman <[email protected]>
@brianteeman
Copy link
Collaborator Author

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

@nikosdion
Copy link
Member

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.

@brianteeman
Copy link
Collaborator Author

This is great, just a bit premature – it's okay, you can't read my mind.

Are you sure about that?

@nikosdion
Copy link
Member

Look, my mind-reading expectations are set very high by Crystal. You can get quite close, but not at that level 🤣

@nikosdion nikosdion added the contemplating Thinking about it label Jan 11, 2024
@morphinestyle
Copy link
Contributor

If it hadn't been for SCSS, I would have gladly taken care of the CSS myself.

@nikosdion
Copy link
Member

@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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contemplating Thinking about it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants