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

Style Guide Concepts

Style Guide Concepts

Ivan Banov

July 01, 2016
Tweet

More Decks by Ivan Banov

Other Decks in Technology

Transcript

  1. X

  2. ▸Tempo ▸Pode virar uma bomba-relógio ▸Vai sentir como se o

    CSS te odiasse ▸Documentação - criar e manter
  3. .box { width: 200px; margin: 0 auto; } .error {

    background: red; } .big { width: 400px; }
  4. // HTML <div class="box error big"> FAIL </div> // CSS

    .box.error { background: darkred; } .box.big { width: 400px; } .box.error.big { background: black; width: 100%; }
  5. .box { width: 100px; } .box--fixed { position: fixed; }

    .box__head { font-size: 2em; } .box__head--big { font-size: 5em; }
  6. // Pré-processadores .box { width: 100px; &--fixed { position: fixed;

    } &__head { font-size: 2em; } &__head--big { font-size: 5em; } }
  7. |- base/ |- _default.scss |- _reset.scss |- layout/ |- _grid.scss

    |-_header.scss |-_footer.scss |- modules/ |-_btn.scss |-_alert.scss |- states/ |-_is-disabled.scss |-_is-hidden.scss |- themes/ |-_blackfriday.scss _application.scss
  8. |- utilities/ |- reset.styl |- grid.styl |- atoms/ |- buttons.styl

    |- inputs.styl |- molecules/ |- alert.styl |- search-form.styl |- organisms/ |- header.styl |- footer.styl |- templates/ |- default.styl |- promo.styl |- about.styl |- pages/ |- index.styl application.styl
  9. $color: red; $size: 200px; .modal { background: $color; width: $size;

    } $color: blue; $size: 900px; .dropdown { color: $color; font-size: $size; }
  10. // Pré-processadores ESPECIFICIDADE .element { prop: value; 1 // Modifier

    &--modifier {...} 1 // Partials &__partial {...} 1 &__partial--modifier {...} 1 // States &.is-hidden {...} 2 &__partial.has-status {...} 2 }
  11. |- mixins/ |- center.styl |- media.styl |- helpers/ |- visibility.styl

    |- base/ |- colors.styl |- images.styl |- components/ |- modal.styl |- dropdown.styl |- layout/ |- header.styl |- footer.styl |- pages/ |- about.styl |- map.styl |- themes/ |- blackfriday.styl
  12. <script src="webcomponentsjs/webcomponents.js"> </script> <link rel="import" href="polymer/polymer.html"> <link rel="import" href="app-avatar.html"> <dom-module

    id="app-user"> <template> <app-avatar user="{{ name }}"></app-avatar> </template> <script> Polymer({ is: 'app-user' }); </script> </dom-module>
  13. .button { background: darkGrey; padding: 10px 20px; color: white; font:

    16px Helvetica; border-radius: 3px; &:hover { background: grey; } &:disabled { background: lightGrey; } &.primary { background: green; } &.remove { background: red; } }
  14. // Botão básico // // :hover - Botão ficara em

    highlight // :disabled - Cor cinza opaco com opacidade // // .primary - Botão para todas as ações básicas // .remove - Botão para negações ou remoções