runemadsen / Magic-Book-Project

DEPRECATED: We are reviving the Magic Book project as a node package: https://github.com/magicbookproject/magicbook
http://itp.nyu.edu
620 stars 62 forks source link

h1 problems #141

Closed shiffman closed 11 years ago

shiffman commented 11 years ago

I'm not sure if this is a magic-book issue (or just something for my CSS in the NOC repo), but having some issues with h1.

It appears the CSS rules are being overriden by the "user agent stylesheet" so this is not being applied:

h1 {
    font-family: "ProximaNova-Regular"
    font-size: 320%;
}

In addition, an empty h2 is being inserted immediately after the book title, which is causing a page break on my title page.

<h1 id="the-nature-of-code">The Nature of Code</h1><h2 id=""></h2>
<p>by Daniel Shiffman</p>
runemadsen commented 11 years ago

Weird. Should be an easy fix. I'll look at it as soon as I find a pocket of time.

stevenklise commented 11 years ago

It looks like "ProximaNova-Regular" is not getting recognized by Prince. Switching to

font-family: "ProximaNova-Bold";

works just fine.

Why would this be?

stevenklise commented 11 years ago

Regarding the h2 element, it can be squashed with CSS as follow:

body>h2:nth-child(2) {
  display: none;
}

This should not cause any other h2 elements to be hidden as rendering to html includes wrapper divs so body>h2 will never be true. And the PDF is rendered as an entire page.

I've pushed branch issue-141 to shiffman/the-nature-of-code@4a438ef to work on this issue.

stevenklise commented 11 years ago

I've switched the h1 and h2 font to ProximaNova-Bold, it might be inappropriate for the h2.

Closing the issue but leaving a note in the CSS about the font.