Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Think CSS

Edward
April 28, 2015

Think CSS

Re-evaluating some CSS best practices by looking back through the history of how we've thought about CSS

Edward

April 28, 2015
Tweet

More Decks by Edward

Other Decks in Technology

Transcript

  1. <table width="100%" style="height: 100%;" cellpadding="10" cellspacing="0" border="0"><tr> <td width="20%" valign="top"

    bgcolor="#999f8e"><a href="#">Menu link</a><br><a href="#">Menu link</ a><br></td><td width="80%" valign="top" bgcolor="#d2d8c7"><h1>Website Logo</ h1><p>Lorem...</p></td></tr></table>
  2. “To begin, view some of the existing designs in the

    list. Clicking on any one will load the style sheet into this very page. The HTML remains the same, the only thing that has changed is the external CSS file. Yes, really.” Dave Shea | CSS Zen Garden
  3. “There are no additional restrictions on the tokens authors can

    use in the class attribute, but authors are encouraged to use values that describe the nature of the content, rather than values that describe the desired presentation of the content.” whatwg.org - Elements spec
  4. “Classitis and divitis are like the unnecessary notes an amateur

    musician plays—the noodling of a high school guitarist when he's supposed to be providing backup to a singer or featured soloist. Classitis and divitis are like the needless adjectives with which bad writing is strewn.” Jeffrey Zeldman | Designing with Web Standards
  5. “To begin, view some of the existing designs in the

    list. Clicking on any one will load the style sheet into this very page. The HTML remains the same, the only thing that has changed is the external CSS file. Yes, really.” Dave Shea | CSS Zen Garden
  6. “There are no additional restrictions on the tokens authors can

    use in the class attribute, but authors are encouraged to use values that describe the nature of the content, rather than values that describe the desired presentation of the content.” whatwg.org - Elements spec
  7. “Classitis and divitis are like the unnecessary notes an amateur

    musician plays—the noodling of a high school guitarist when he's supposed to be providing backup to a singer or featured soloist. Classitis and divitis are like the needless adjectives with which bad writing is strewn.” Jeffrey Zeldman | Designing with Web Standards
  8. “I saw the best minds of my generation destroyed by

    madness, starving hysterical naked...burning for the ancient heavenly connection to the starry dynamo in the machinery of night” Allen Ginsberg | Howl
  9. nav ul li.facebook { background: url(facebook.png); } nav ul li.twitter

    { background: url(twitter.png); } nav ul li.youtube { background: url(youtube.png); }
  10. nav ul li:nth-child(1) { background: url(facebook.png); } nav ul li:nth-child(2)

    { background: url(twitter.png); } nav ul li:nth-child(3) { background: url(youtube.png); }
  11. nav li a { text-decoration: none; color: inherit; border-radius: 5px;

    background-color: #ddd; float: left; width: 20%; }
  12. nav li a { /* reset */ text-decoration: none; color:

    inherit; } nav li a { /* layout */ float: left; width: 20%; } nav li a { /* style */ border-radius: 5px; background-color: #ddd; }
  13. .navItem__link { /* reset */ text-decoration: none; color: inherit; }

    .navItem__link { /* layout */ float: left; width: 20%; } .navItem__link { /* style */ @include border-radius(5px); background-color: #ddd; }
  14. %reset-link-style { ...} %nav-item-theme { ...} .nav li a {

    @extend %reset-link-style; /* reset */ @extend %nav-item-theme; /* theme */ @include columns(1-of-4); /* layout */ }
  15. Don't throw the past away You might need it some

    rainy day Dreams can come true again When everything old is new again Peter Allen | Everything Old Is New Again
  16. ❦ Simple Made Easy — Rich Hickey About HTML semantics

    & front-end architecture — Nicolas Gallagher