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

CSS 設計ことはじめ

CSS 設計ことはじめ

2016.08.19 イドバタ会議#2 にて発表したスライドです。

Toro_Unit (Hiroshi Urabe)

August 19, 2016
Tweet

More Decks by Toro_Unit (Hiroshi Urabe)

Other Decks in Technology

Transcript

  1. Toro_Unit ઎෦ ߛ (͏Β΂ ͻΖ͠) Web Designer / Front-end Engineer

    / WordPress Plugin Developer Github: @torounit Twitter: @Toro_Unit Facebook: fb.me/torounit Blog: https://torounit.com 2016.8.19 @ΠυόλΧΠΪ Vol.2 3
  2. ͨͱ͑͹͜ΜͳHTML <h1 class="title">αΠτͷλΠτϧ</h1> <main id="main-contents"> <h1 class="title">ϒϩάͷλΠτϧ</h1> <article class="post"> <header

    class="headline"> <h1 class="title">هࣄͷλΠτϧ</h1> </header> </article> </main> 2016.8.19 @ΠυόλΧΠΪ Vol.2 18
  3. CSSͬͯ؆୯! .title { color: red; } .post .title { color:

    orange; } 2016.8.19 @ΠυόλΧΠΪ Vol.2 20
  4. CSSͬͯ؆୯????? .title { color: red; } #main-contents .title { color:

    green; } .post .title { color: orange; /*্ॻ͖͞ΕΔɻɻɻ*/ } 2016.8.19 @ΠυόλΧΠΪ Vol.2 21
  5. CSSͬͯ؆୯???????????????? .title {} #main-contents .title {} .post .title {} h1.title

    {} main#main-contents article .title {} main#main-contents .headline h1 {} main article header h1.title {} main#main-contents .post:first-child h1 {} 2016.8.19 @ΠυόλΧΠΪ Vol.2 22
  6. ͪΌΜͱͨ͠CSSͱ͸ʁ • ༧ଌ͠΍͍͢ • ࠶ར༻͠΍͍͢ • อक͠΍͍͢ • ֦ு͠΍͍͢ CSS

    Architecture — Philip Walton ೔ຊޠ༁ 2016.8.19 @ΠυόλΧΠΪ Vol.2 25
  7. .main-contents h1 { margin-bottom: 1em; /*͕ͬͪ͜ద༻͞ΕΔ*/ } .entry {} .entry__title

    { margin-bottom: .5em; font-size: 1.7em; } ͋ͬΕʔʁ͓͔͍͠ͳ͊ɻ 2016.8.19 @ΠυόλΧΠΪ Vol.2 33
  8. ͜͏͢Δ!!! h1 { margin-bottom: 1em; } .entry {} .entry__title {

    margin-bottom: .5em; /*͕ͬͪ͜ద༻͞ΕΔ!*/ font-size: 1.7em; } 2016.8.19 @ΠυόλΧΠΪ Vol.2 34
  9. • ίϯϙʔωϯτ͝ͱʹϑΝΠϧΛ෼ׂɻίϯϙʔωϯτͷ໾ ׂΛ͸͖ͬΓͤ͞Δɻ • ଞͷίϯϙʔωϯτʹ͸৮Βͳ͍ɻ • CSS ϑΝΠϧ͕͍ͬͺ͍Ͱਏ͍ʁ Sass /

    LESS / Stylus / postcss ͋ͨΓΛར༻͢Ε͹ྑ͍Μ͡Όແ͍Ͱ͠ΐ͏͔ʁ 2016.8.19 @ΠυόλΧΠΪ Vol.2 37
  10. 4.۩ମతͳίϯϙʔωϯτͳͲͷઃܭํ਑. υΩϡϝϯτΛॻ͍ͯ΋ྑ͍Ͱ͕͢ɺͲ͏ͤϝϯςφϯε͠ͳ ͘ͳΔΜͰɺެ։͞Ε͍ͯΔΞʔΩςΫνϟʔͳͲΛऔΓೖΕ Α͏ɻ • OOCSS / SMACSS / BEM

    / SUIT CSS / FLOCSS / ITCSS / ECSS ... • ͱΓ͋͑ͣɺOOCSSɾSMACSSɾBEM ͋ͨΓ͸جຊతͳߟ ͑ํʹͳΔͷͰԡ͓͑ͯ͜͞͏ɻ 2016.8.19 @ΠυόλΧΠΪ Vol.2 38
  11. • CSSͷઃܭʹۜͷ஄ؙͳͲͳ͍ʂ • ઃܭΛߟ͑ͳ͕Β੔ཧ੔಴ɻৗʹϦϑΝΫλϦϯά͠ͳ͕Β ։ൃ͢Δ΂͠ɻ • WP-D Week Ͱ CSS

    ͷ࿩Λ͠·ͨ͠ɻͦͯ͠ CSS ઃܭͱ෦԰ ͷ૟আʹ͍ͭͯɻ – Toro_Unit 2016.8.19 @ΠυόλΧΠΪ Vol.2 40
  12. Thanks! Speaker Deck: https://speakerdeck.com/torounit Github / @torounit Twitter: @Toro_Unit Facebook:

    fb.me/torounit Blog: https://torounit.com 2016.8.19 @ΠυόλΧΠΪ Vol.2 42