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

CSS Dev Conf

jina
December 05, 2012

CSS Dev Conf

jina

December 05, 2012
Tweet

More Decks by jina

Other Decks in Design

Transcript

  1. It used to be that designers made an object and

    walked away. Today the emphasis must shift to designing the entire life cycle.” ” —Paul Saffo
  2. ul.items a { ... } ul.items:hover { ... } .ie-6

    ul.items a { ... } Output: SCSS: ul.items a { ... &:hover { ... } .ie-6 & { ... } }
  3. ul.items { ... } @media print { ul.items { ...

    } } Output: SCSS: ul.items a { ... @media print { ... } }
  4. .sidebar { border: 1px solid #eee; border-top-color: #fff; border-left: 0;

    } Output: SCSS: .sidebar { border: 1px solid #eee { top-color: #fff; left: 0; } }
  5. body { color: #444; } footer { background: #444; }

    Output: SCSS: $text: #444; $bg: $text; body { color: $text; } footer { background: $bg; }
  6. .module { padding: 1em; } .info { padding: 2em }

    Output: SCSS: @mixin spacing($s: 1em) { padding: $s; } .module { @include spacing; } .info { @include spacing(2em); }
  7. .message, .error { ... } .message.alert, .error.alert { ... }

    .error { ... } Output: SCSS: .message { ... &.alert { ... } } .error { ... @extend .message; }
  8. .module, .sidebar { color: #444; } .sidebar, .main { width:

    240px; } Output: SCSS: .module { color: #444; } %grid-1 { width: 240px; } .sidebar { @extend .module; @extend %grid-1; } .main { @extend %grid-1; }
  9. $text: #444 color: lighten($text, 5%); color: darken($text, 5%); color: saturate($text,

    5%); color: adjust-hue($text, 180); color: grayscale($text); color: mix($text, #fff);
  10. /* Multiline comment; appears in output */ Output: SCSS: /*

    Multiline comment; appears in output */ // Singleline comment; // Hidden from output
  11. .i-red { background: url(red.png); } .i-blue { background: url(blue.png); }

    Output: SCSS: @each $c in red, blue { .i-#{$c} { background: url(#{$c}.png); } }
  12. .i-red { color: red; } .i-blue { color: blue; }

    Output: SCSS: @mixin i($color) { @if $color == red { color: red; } @else { color: blue; } } .i-red { @include i(red); } .i-blue { @include i; }
  13. // --------------------------------------------------------- // 03. DEPENDENCIES // Variables/mixins/placeholders/etc // These don’t

    emit CSS on their own // until they are used. @import "dependencies/measurements"; @import "dependencies/typography"; @import "dependencies/color"; @import "dependencies/images"; @import "dependencies/themes";
  14. // --------------------------------------------------------- // 04. FOUNDATION // Plain semantic HTML //

    No classes/IDs are introduced yet. @import "foundation/page"; @import "foundation/links"; @import "foundation/headings"; @import "foundation/text"; @import "foundation/lists"; @import "foundation/forms";
  15. // ---------------------------------- // 05. COMPONENTS // Reusable modules, components, etc.

    @import "components/buttons"; @import "components/messaging"; @import "components/dropdowns";
  16. // ---------------------------------- // 06. LAYOUT @import "layout/grid"; @import "layout/banner"; @import

    "layout/navigation"; @import "layout/complementary"; @import "layout/contentinfo";
  17. Do

  18. Be regular and orderly in your life so that you

    may be violent and original in your work.” ” —Gustave Flaubert