Skip to content

Many (most?) html files need a viewport tag #289

@eshellman

Description

@eshellman

@JohannesSeikowsky: (gutenbergtools/gutenbergsite#170)
I tried yesterday to actually read a Gutenberg book on my smartphone and it seems to me that the page of the book is not really well adjusted for reading on mobile. The page I'm talking about is the one users get to when clicking the "Read now" button on the page of a book.

@Rossolson : Setting the viewport is the fundamental first step in supporting mobile-friendly views. (I haven’t dug into the code from that time, and I’m now wondering if there was a bad viewport setting that was removed entirely rather than fixed.)

History: when ebookmaker first started converting xhtml to HTML5, it automatically added a viewport meta tag. However, it was found that in a minority of cases, it disfigured the HTML.

To make the books more mobile friendly, we should see how we can start adding it again without damaging previously fine HTML.

I think that #66712 convinced me to cease adding the viewport tag. without it, it responds beautifully on iphone, (using media queries) with the added viewport tag, it acquires a large right margin making the text much less readable.

I think it's not too hard to open a file in a headless chrome browsre and use injected javascript to measure the viewport, comparing it to what the viewport tag would set. That should indicate if setting a viewport on the file is likely to cause problems. opening our files in headless chrome is slow; but we're going to be doing that anyway for pdf generation (#258); so we'll have to tackle that anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions