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

Default HTML/CSS needs to look reasonable and be responsive #16

Closed
simonw opened this issue Oct 23, 2017 · 6 comments
Closed

Default HTML/CSS needs to look reasonable and be responsive #16

simonw opened this issue Oct 23, 2017 · 6 comments

Comments

@simonw
Copy link
Owner

simonw commented Oct 23, 2017

Version one should have the following characteristics:

  • Looks OK
  • Works great on mobile
  • Loads extremely fast
  • No JavaScript! At least not in v1.
@simonw simonw added this to the Ship v1 milestone Oct 23, 2017
@simonw
Copy link
Owner Author

simonw commented Oct 23, 2017

I could use the table-reflow mechanism demonstrated here: http://demos.jquerymobile.com/1.4.3/table-reflow/

@simonw simonw added the large label Oct 24, 2017
@simonw
Copy link
Owner Author

simonw commented Oct 25, 2017

https://sitesforprofit.com/responsive-table-plugins-and-patterns has some useful links.

I really like the pattern from https://css-tricks.com/responsive-data-tables/

/* 
Max width before this PARTICULAR table gets nasty
This query will take effect for any screen smaller than 760px
and also iPads specifically.
*/
@media 
only screen and (max-width: 760px),
(min-device-width: 768px) and (max-device-width: 1024px)  {

    /* Force table to not be like tables anymore */
    table, thead, tbody, th, td, tr { 
        display: block; 
    }
    
    /* Hide table headers (but not display: none;, for accessibility) */
    thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr { border: 1px solid #ccc; }
    
    td { 
        /* Behave  like a "row" */
        border: none;
        border-bottom: 1px solid #eee; 
        position: relative;
        padding-left: 50%; 
    }
    
    td:before { 
        /* Now like a table header */
        position: absolute;
        /* Top/left values mimic padding */
        top: 6px;
        left: 6px;
        width: 45%; 
        padding-right: 10px; 
        white-space: nowrap;
    }
    
    /*
    Label the data
    */
    td:nth-of-type(1):before { content: "First Name"; }
    td:nth-of-type(2):before { content: "Last Name"; }
    td:nth-of-type(3):before { content: "Job Title"; }
    td:nth-of-type(4):before { content: "Favorite Color"; }
    td:nth-of-type(5):before { content: "Wars of Trek?"; }
    td:nth-of-type(6):before { content: "Porn Name"; }
    td:nth-of-type(7):before { content: "Date of Birth"; }
    td:nth-of-type(8):before { content: "Dream Vacation City"; }
    td:nth-of-type(9):before { content: "GPA"; }
    td:nth-of-type(10):before { content: "Arbitrary Data"; }
}

simonw pushed a commit that referenced this issue Nov 6, 2017
@simonw
Copy link
Owner Author

simonw commented Nov 6, 2017

Default look with Bootstrap 4 looks like this:
flights

simonw pushed a commit that referenced this issue Nov 11, 2017
No need for all of bootstrap since we only need to style a few elements.

Implemented responsive table pattern from here:
https://css-tricks.com/responsive-data-tables/

Refs #16
@simonw
Copy link
Owner Author

simonw commented Nov 11, 2017

Here's what a table looks like now at a smaller screen size:

parlgov-development__info_data_source

@simonw simonw added small and removed large labels Nov 11, 2017
@simonw
Copy link
Owner Author

simonw commented Nov 11, 2017

Still needed:

  • A link to the homepage from some kind of navigation bar in the header
  • link to github.com/simonw/datasette in the footer
  • Slightly better titles (maybe ditch the visited link colours for titles only? should keep those for primary key links)
  • Links to the .json and .jsono versions of every view

@simonw
Copy link
Owner Author

simonw commented Nov 11, 2017

Closing this, opening a fresh ticket for the navigation stuff.

@simonw simonw closed this as completed Nov 11, 2017
@simonw simonw mentioned this issue Nov 11, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant