On Github Hackapalooza / CSS-Typography
You can download these slides HERE
Typography has one plain duty before it and that is to convey information in writing. No argument or consideration can absolve typography from this duty. A work which cannot be read becomes a product without purpose.
Lorem ipsum dolor sit amet, consectetur adipisicing.
Lorem ipsum dolor sit amet, consectetur adipisicing.
Lorem ipsum dolor sit amet, consectetur adipisicing.
Lorem ipsum dolor sit amet, consectetur adipisicing.
Pairing typefaces is much like choosing flavors at an ice cream shop. We know about common “go-to” pairings like chocolate with vanilla, but we try to find inspiring combinations where each flavor highlights something special about the other.
– Typekit Blog<div class="body-type"> <p>Zachary Kain is a hardware, software and thought-ware maker on the @heistmade crew. He works as a designer & writer creating compelling new media experiences, and devotes his spare time towards making humanity smarter through creative and technical education.</p> <h3>My Ethos</h3> <p>Believe in community. Learn from your peers every day, and every day aim to teach someone in turn. It is important to remember where we come from, and how we arrived where we are.</p> <p>Be mindful of the artifacts and culture you create; strive to uphold principles of accessibility, durability and social sustainability. Ply your trade in the service of positive change.</p> </div>
Add a class of profile-img to your profile photo
<img class="profile-img" src="images/photo_zak.jpg">
#about .body-type { font-family: "Droid Serif", serif; font-size: 14px; line-height: 1.6; }
Let's turn our big text block into a newspaper-inspired column layout
#about .body-type { column-count: 2; column-gap: 40px; column-rule: 1px solid lightgrey; }
Some browsers need a special version of the "column" rules to make it work:
/* Chrome, Safari, iPhone, etc */ -webkit-column-count: 2; -webkit-column-gap: 40px; -webkit-column-rule: 1px solid lightgrey; /* Firefox */ -moz-column-count: 2; -moz-column-gap: 40px; -moz-column-rule: 1px solid lightgrey; /* Internet Explorer */ column-count: 2; column-gap: 40px; column-rule: 1px solid lightgrey;
#about .profile-img { float: left; /* push the image to the side */ margin-right: 30px; /* make some space between the image and our text */ max-width: 150px; /* restrict the size of the image */ box-shadow: 0 0 4px 2px lightgrey; /* add a nice subtle shadow */ }
Pretty good, right? But let's push it further!
<p class="larger"> Zachary Kain is a hardware, software and thought-ware maker on the @heistmade crew. He works as a designer & writer creating compelling new media experiences, and devotes his spare time towards making humanity smarter through creative and technical education. </p>
Now let's style that "larger" paragraph
#about p.larger { /* font size and line height */ font-size: 1.25em; line-height: 1.5; /* little refinements and details */ font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
/* remove the space on top of paragraphs */ #about p { margin-top: 0; } /* fix up that sub-heading */ #about h3 { margin-top: 0; font-family: "Oswald", sans-serif; font-weight: 700; text-transform: uppercase; /* BREAK a new column BEFORE this element */ -webkit-column-break-before: always; -moz-column-break-before: always; column-break-before: always; }
"Media Queries" let us write CSS that only works at a certain screen size. They look like this:
@media (max-width: 800px) { #about { background: red; } }
At around 1100px wide, our .larger text starts breaking down
@media (max-width: 1100px) { #about .profile-img { max-width: 40%; /* make the image wider */ margin: 0 auto 40px; /* give it some space on the bottom */ display: block; /* make sure it pushes down our paragraphs */ float: none; /* remove the float we put on earlier */ } }
At around 800px, 2-columns gets a bit cramped
@media (max-width: 800px) { #about .body-type { /* take our block down to one column, from two */ -webkit-column-count: 1; -moz-column-count: 1; column-count: 1; } #about p.larger { /* give our larger paragraph some bottom space */ margin-bottom: 2em; } }
@media (max-width: 481px) { #about { padding-left: 20px; padding-right: 20px; } }
Typography has one plain duty before it and that is to convey information in writing. No argument or consideration can absolve typography from this duty. A work which cannot be read becomes a product without purpose.
You can download these slides HERE