3. #ebookcraft
A BIO IN 5 MINUTES
• Live near Boston, Massachusetts after
foolishly transplanting from Miami
• M.A. in Writing & Publishing from
Emerson College (2012 — Go Lions!)
• Worked on ebooks at O’Reilly &
F+W Media
• Currently Director, Solutions
Architecture at Aptara
• Teach ebook production at Emerson
College’s graduate program
• Dabble in doodles & comics, love corgis
5. #ebookcraft
WORKSHOP STRUCTURE
• 2.5 hours* of CSS goodness
• Half “lecture,” half lab
• Three parts
• Open questions for discussion
• Reviewing samples, etc.
• Simple exercises
• *15-minute break in-between
6. #ebookcraft
WORKSHOP MATERIALS
Download the following materials for this workshop at
irisamelia.com/ebookcraft2015
ebookcraft_exercises.zip
Tools:
• EPUBcheck (e.g., EPUB-Checker/Pagina)
• Zip/Unzip scripts for EPUBs
• iBooks/ADE/iPad (use Dropbox)
9. #ebookcraft
THINKING OF “EBOOK BEAUTY”
• What makes an ebook beautiful ?
• 2 approaches:
• Beautiful rendering
• Beautiful markup
!
• How do we put them together?
12. #ebookcraft
PART ONE: RENDERING
• Open question: What immediately comes to
mind when I mention “beautiful/lovely/gorgeous
rendering”?
• We think of aesthetic
• Design
• How it looks
13. #ebookcraft
PART ONE: RENDERING
• Open question: Do we associate this notion of
“ebook beauty” to particular genres?
Cookbooks / Nonfiction / Fiction / Poetry
16. #ebookcraft
“A GREAT UI IS INVISIBLE.”
—PATRICK COX
http://tympanus.net/codrops/2013/03/21/a-great-ui-is-invisible/
17. #ebookcraft
WHAT DOES AN EBOOK’S
“UI” DO?
• Establishes a tone for your ebook (branding)
• Establishes relationships with and within the
content (hierarchy)
• Establishes a connection to the user (reader)
18. #ebookcraft
DOWNTOTHE DETAILS
Successful ebooks are all about the details, specifically,
the elements the reader doesn’t necessary explicitly
acknowledge
• Subtle
• Warranted for the content
20. #ebookcraft
RESOLVE WITH REFLOWABLE
• We do not have page-by-page design available
(yet) to us, so flexibility is key
• Reflowability comes with a double-edged sword
• However, we should take advantage of robust
rendering engines (i.e., iBooks)
21. #ebookcraft
OPPORTUNITIES FOR DETAILS
TYPICAL EXAMPLES
• Dropcaps and initial lines
• Chapter headers with dingbats
• Journal entries or other passages with embedded fonts
• Line spacing for running text
• Margins & padding for running text
22. #ebookcraft
DROPCAPS & INITIAL LINES
Why it’s important
• Opportunity for print
fidelity (are you happy now,
editors!?)
• Attention to detail
CSS:
• float:;, line-height:;, font-
variant:; http://www.magazinedesigning.com/wp-content/uploads/2013/07/drop-caps-initials-2.png
27. #ebookcraft
PASSAGES/TEXT BLOCKS
(E.G., JOURNAL ENTRIES)
Why it’s important
• Distinguishes running text from segmented text
• Opportunity for enhancing the narrative (and UX)
with fonts etc.
CSS:
• block (<div>/<section>) to block off the letter itself
• text-indent:; for paragraphs
• margin/padding:; for spacing relative to the running text
• line-height:;,
29. #ebookcraft
RUNNINGTEXT
LINE HEIGHT & WORD SPACING
Why it’s important:
• Controls space between lines of text, space between
letters (respectively)
• Gives your text breathing room
• Makes your text more legible — but also allows for
greater density
CSS: line-height:; / letter-spacing:;
Value has no unit so that it is proportional to the font size
30. #ebookcraft
RUNNINGTEXT
MARGIN & PADDING
Why it’s important:
• Gives your text breathing
room
• Gives you more control of
the page
CSS:
• margin:; — outside
• padding:; — inside http://www.kuahla.com/learnhtml/images/boxmodel.gif
33. #ebookcraft
RECAP: RENDERING
• Attention, thought, and execution brings
readers back to an ebook — or, arguably, its
provider (cough you great developer you)
• It makes the book memorable, beyond the content
itself
37. #ebookcraft
BENEATHTHE SURFACE
• Successful implementation of CSS depends on the
foundation laid in the source HTML.
• You can’t style clutter!
• You need beautiful markup.
41. #ebookcraft
BEAUTIFUL MARKUP IS SEMANTIC
• Thoughtful breaking up of the content
• Thinking of function for complex books
• Scenario to consider: Slow page turns
• Open question: When should semantics be put
on the back-burner? Should it ever?
42. #ebookcraft
BEAUTIFUL MARKUP IS EFFICIENT
• Efficient markup does the work for you
• Remember The First Virtue of a Great
Programmer
• Templates
• Maintainability
45. #ebookcraft
THE MUST-HAVES
OF A CSS DOCUMENT
• Organization (emphasis onThe Cascade)
• The minimum required (conciseness — exception
for templates)
• Comments for your reference (information on
when it was last edited)
60. #ebookcraft
EXERCISE: CSS CLEANUP
Your mission, should you choose to accept it…
1. Take Exercise_CSS-Cleanup.css and reduce its
line count.
2. Organize the elements with comments.
61. #ebookcraft
SAMPLE “ANSWER”
• There are many approaches to this (can be
combined)
• More content-driven (paragraphs, chapters,
sections, etc)
• More semantics-driven (purely by the element)
• Generally: @font-face{}/@page{} at the top
(global)
63. #ebookcraft
EXERCISE: RUNNINGTEXTT.L.C.
Your mission, should you choose to accept it…
1. Navigate to CSS_Exercises-1.xhtml within
CSS_Exercises.epub within a text editor.
2. Give the text some breathing room with new
CSS. Identify elements that need to be offset in
some way via alignment or other means.
65. #ebookcraft
EXERCISE: BLOCK PARTY
Your mission, should you choose to accept it…
1. Navigate to CSS_Exercises-2.xhtml within
CSS_Exercises.epub within a text editor.
2. There are a number of elements here that need to be styled.
Make sure you utilize the following rules (be playful!):
• border (radius, color, width, etc)"
• background-image"
• margin & padding
68. #ebookcraft
EXERCISE: JUXTAPOSITION
Your mission, should you choose to accept it…
1. Navigate to CSS_Exercises-3.xhtml within CSS_Exercises.epub
within a text editor.
2. Who doesn’t love Edgar Allan Poe?The answer: Children!
3. Your EPUB has the complete story of The Cask of Amontillado. Use your
CSS skills to create a version of this Poe favorite like a children’s book.
4. (Yes, I’m a little insane.)
73. #ebookcraft
CONTACT ME
I love making new friends & colleagues. Please reach out!
Twitter: @epubpupil
Email: iris.febres@aptaracorp.com or iris_febres@emerson.edu
LinkedIn: linkedin.com/in/irisamelia
74. #ebookcraft
REFERENCES
• Judging a Book by Its CSS (Iris Febres)
http://www.booknetcanada.ca/blog/2015/2/12/judging-a-book-by-its-
css.html#.VPe4YGTF-RI
• Degristling the Sausage, BBEdit 11 Edition (India Amos)
http://ink.indiamos.com/2015/02/12/degristling-the-sausage-bbedit-11-edition/
• Fun with Line Height! (Chris Coyer)
https://css-tricks.com/fun-line-height/
• A Great UI is Invisible (Patrick Cox)
http://tympanus.net/codrops/2013/03/21/a-great-ui-is-invisible/
• Mozilla Developer Network
https://developer.mozilla.org/