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

Compatibility epub build breaks footer alignment in poetry #512

Open
weijia-cheng opened this issue Apr 22, 2022 · 2 comments
Open

Compatibility epub build breaks footer alignment in poetry #512

weijia-cheng opened this issue Apr 22, 2022 · 2 comments

Comments

@weijia-cheng
Copy link
Member

weijia-cheng commented Apr 22, 2022

This is what I came across while testing #511, the poetry build fix.

Despite de Cleyre having CSS to right-align footers, the footer in the compatibility build is left-aligned:

Screenshot 2022-04-22 at 08-49-08 Poetry

Inspection of the CSS indicates that the reason this is happening is that the compatible poem CSS is more specific than the footer CSS:

Screenshot from 2022-04-22 08-50-23

The relevant rules from the extracted CSS are

.epub-type-z3998-poem p,
.epub-type-z3998-hymn p{
  text-align: left;
  text-indent: 0;
}

and

footer{
  font-variant: small-caps;
  margin-top: 1em;
  text-align: right;
}
@acabal
Copy link
Member

acabal commented Apr 25, 2022

It's not obvious to me how a general solution to this would look. We would have to calculate specificity for children of verse and try to generate a more specific selector to pass that specificity target. That sounds very complex. We can already get specificity but generating a selector to somehow achieve specificity + 1 without messing up any other selectors might not be solvable. This might just be a case where the Kobo build is going to have to suffer slightly because of their damn spans.

I'll leave this issue open for now in case someone wants to pick it up, or I get hit by inspiration. But, I don't have time to think about it any time soon unfortunately.

@weijia-cheng
Copy link
Member Author

Ok, I just want to point out that this isn't a Kobo problem only but affects all of the compatible (i.e. non-advanced) epubs.

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