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

[Kobo iOS] [Kobo Android] Publisher’s default + text-align #28

Closed
JayPanoz opened this issue Sep 6, 2016 · 4 comments
Closed

[Kobo iOS] [Kobo Android] Publisher’s default + text-align #28

JayPanoz opened this issue Sep 6, 2016 · 4 comments
Assignees

Comments

@JayPanoz
Copy link

JayPanoz commented Sep 6, 2016

So, when text-align is not declared in the CSS and you pick “Publisher’s default” setting in the menu, the whole text is centered (by default).

For the record, if you set text-align: left for h1 for instance, then the whole text is left-aligned when using this setting.

Applies to Kobo iOS and Kobo Android.

@bdugas
Copy link
Contributor

bdugas commented Sep 28, 2016

Can you send a sample ePub or do you know of any files formatted in this way that are already in production? I'd be interested in testing in both environments.

@bdugas bdugas self-assigned this Sep 28, 2016
@bdugas
Copy link
Contributor

bdugas commented Dec 6, 2016

@JayPanoz just checking again to see if you have a sample? It would be difficult to scan our system specifically for a file with that CSS.

@bdugas bdugas closed this as completed Dec 6, 2016
@JayPanoz
Copy link
Author

JayPanoz commented Feb 16, 2017

Ok so there’s actually no need for a sample, the solution is actually pretty simple.

In my EPUB file I had:

div {
  text-align: center;
}

And there was no text-align declaration for other selectors.

The assumption being: “well, I'm using div only for images so I don't need to attribute it a class.”

photo 16-02-2017 12 48 33

Since contents are appended in a div, text-align: center applies to the whole HTML file (1) when no text-align user setting is set.

When the user setting is set (2), text-align is set for div#inner-book.

That's probably an edge case but as far as I can remember, it's not the first time I encounter EPUB files in which such a prop is declared for a global element so I guess it's worth reporting it.

Maybe declaring a fallback text-align for body before the author’s CSS then assigning the inherit value to#book-columns or #inner-book, without !important could solve this?

@bdugas
Copy link
Contributor

bdugas commented Feb 21, 2017

@JayPanoz thanks for the follow up and the snippet. I'm not going to log this as a bug fix because 1) it is an edge case (we don't see this happen in any of the content we review) and 2) technically our app is doing what the content is telling it.
That said if we do see this display issue pop up in QA we'll refer back to this and see if we need to implement something on Android that will compensate for justification applied to the div tag.

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

No branches or pull requests

2 participants