Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

ePub exports redundant CSS styles

Return to Member Forum

  • Author
    Posts
    • #61867
      celkins
      Participant

      I've completed Anne-Marie's ePubs tutorial at Lynda.com (HIGHLY RECOMMENDED) and can output a good-looking ePud from ID CS5.5 that validates to .mobi. I can't leave well enough alone, so I wanted to clean up the CSS using what I learned from Anne-Marie. I'm having problems on two issues:

      1. I created the files in my book using a template, so all paragraph and character styles are alike across chapters and there are zero overrides. During export, ID creates its template.css containing separate CSS styles for each of the chapters. So I get Note, Note-1, Note-2, etc. That makes the CSS huge and impossible to edit.

      2. To combat problem 1, I created a tidy CSS file (called cookbook.css) and instructed ID to use it during export. I guess that ID uses it but it then outputs its own template.css and each HTML file continues to reference the template.css and not my cookbook.css. The new template.css is much cleaner, but the HTML files continue to call for individual styles (Note-1, Note-2, etc.). Therefore, nothing gets styled in the book because my tidy CSS file has no styles for Note-1, Note-2, etc.

      Can anyone spot what I might be doing wrong?

    • #61868
      celkins
      Participant

      I've solved my problem. But in case anyone else has this problem, here is what I was doing wrong. I forgot to map all of my paragraph styles in every chapter. This was easy to fix because I work from a template.

      1. In the template's Paragraph Styles panel, I selected Edit All Export Tags from the panel menu. For each style, I mapped to the appropriate CSS style and class that I set up in my custom CSS file.

      2. From the book panel, I selected all chapter files and synced them to the template's paragraph styles using the icon in the book panel's toolbar.

      3. From the book panel's menu, I selected Export Book to EPUB and designated that the custom CSS file be used. (Note that ID uses that file but renames it to template.css during export.)

      VOILA! A clean template.css file and the epub styled correctly.

      I can't empathize enough how important it is that you remove all overrides in your files to keep your CSS clean.

      I found a helpful discussion of some of these issues at https://www.creativeprogression…..he-rescue/

    • #64487
      MacGene
      Member

      Same problem, similar solution, although I wished I had read your solution first. I posted my description, hoping for some help, but after considerable experimentation, arrived at the same conclusion: the ebook conversion process was essentially exporting each file as if it were a new iteration of the previous set of styles, adding an integer after each set corresponding to each file to distinguish one from another. With some thirty files in the group, you can imagine the size of the CSS . . .

      I thought it may be possible to use a template file in another way, perhaps to create a fairly clean CSS file right from the beginning: simply create a document with sufficient paragraph returns to enable use of every paragraph and character tag in your suite of styles; export to an epub and extract the CSS file, clean it up as desired, and rename. Presto, basic CSS. Proceed as above.

Viewing 2 reply threads
  • The forum ‘EPUB and eBook’ is closed to new topics and replies.
Forum Ads