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

Style Guideとstylelintを使ってHTML/CSSを綺麗に書こう!

Style Guideとstylelintを使ってHTML/CSSを綺麗に書こう!

大塚真言

January 31, 2020
Tweet

More Decks by 大塚真言

Other Decks in Programming

Transcript

  1. Style GuideͱstylelintΛ࢖ͬͯ
    HTML/CSSΛ៉ྷʹॻ͜͏ʂʂ
    2020/01/31 WebφΠτٶ࡚ vol.8
    େ௩ਅݴ

    View full-size slide

  2. LTͷର৅ऀ
    • ΤϯδχΞͷҰา໨ͱͯ͠HTML/CSSษڧத
    • όοΫΤϯυΤϯδχΞͰยखؒͰϚʔΫΞο
    ϓॻ͍͍ͯΔ
    • ٯʹΰϦΰϦͷϑϩϯτΤϯυΤϯδχΞʹ
    ͸෺଍Γͳ͍͔΋Ͱ͢ɻɻɻ

    View full-size slide

  3. ࣗݾ঺հ
    -BSBWFM
    7VFKT
    'JSFCBTF
    α΢φେ޷͖ͳ8FCΤϯδχΞ"

    View full-size slide

  4. ձࣾ঺հʢ֓ཁʣ
    ߹ಉձࣾϊϚυϦ
    ૑ۀظ໨
    ϝϯόʔ໊
    8FCܥडୗ։ൃ
    ϑϧϦϞʔτ

    View full-size slide

  5. ձࣾ঺հʢ࢓ࣄʣ
    • Vue.jsͷಋೖࢧԉɾઃܭ࣮૷ϨϏϡʔ
    • ҩྍܥWebαʔϏεͷUI/UXվળʢLaravelʣ
    • ҩྍܥΞϓϦͷ৽نडୗ։ൃʢCordova+Vue.js+Firebaseʣ
    • JAMstackϕʔεͷ੩తαΠτߏங
    ʢNuxt.js+Netlify+contentfulʣ

    View full-size slide

  6. Έͳ͞Μ
    HTML/CSSΛ៉ྷʹ
    ॻ͚͍ͯ·͔͢ʁ

    View full-size slide

  7. HTML/CSS͸
    ࠷ॳʹগ͠ษڧͯ͠Ҏ߱
    ͕ͬͭΓษڧ͢Δ͜ͱ
    ͕গͳ͍

    View full-size slide

  8. ࠓ೔ͷൃදͰ
    ͳΜͱͳ͘ͰHTML/CSSΛ
    ॻ͍͍ͯΔͻͱ͕
    ࣗ৴Λ࣋ͬͯॻ͚Δ

    View full-size slide

  9. ͋ͳͨ
    Ͳ͏ϨϏϡʔ͢Δʁ

    View full-size slide

  10. Google HTML/CSS
    Style Guide

    View full-size slide

  11. Google HTML/CSS Style Guide
    • Google͕ఏڙ͢ΔίʔσΟϯάΨΠυ
    • https://google.github.io/styleguide/
    • Java, Shell, JavaScript, HTML/CSSͳͲଟ਺
    • Πϯσϯτ΍Ҿ༻ූɺCSSϓϩύςΟͷฒͼ
    ॱͳͲͷϧʔϧ͕·ͱ·͍ͬͯΔ

    View full-size slide

  12. Πϯσϯτ͸ۭനݸͱ͢Δ
    λϒͰͷΠϯσϯτ͸ېࢭͱ͢Δ
    Ϧετཁૉ͸վߦ͢Δ͜ͱ
    ϧʔϧ

    View full-size slide

  13. )5.-$44ͷશͯͷίʔυ͸جຊతʹখจࣈΛ࢖͏͜ͱ
    ՄೳͳݶΓলུܗͷϓϩύςΟΛ࢖͏͜ͱ
    ஋͕ͷ৔߹͸୯ҐΛলུ͢Δ
    Χϥʔίʔυ͸ՄೳͳݶΓจࣈͷਐදهΛ࢖༻͢Δ
    ϧʔϧ

    View full-size slide

  14. HTMLʹൺ΂ͯ
    CSSͷํ͕ϧʔϧ͕ଟ͍

    View full-size slide

  15. ϧʔϧ͕ଟ͍ͱ
    νΣοΫ͢Δͷ͕େม

    View full-size slide

  16. ͦ͜Ͱ
    CSSͷ੩తղੳπʔϧ
    StylelintΛ࢖͓͏

    View full-size slide

  17. Stylelint
    • CSSʹಛԽͨ͠ίʔυνΣοΫπʔϧ
    • 170΄Ͳͷϧʔϧ͕͋Γɺϧʔϧҧ൓ͷίʔυΛ
    νΣοΫͯ͘͠ΕΔ
    • ͞ΒʹɺGoogle HTML/CSS Style Guide ʹ४ڌ
    ͨ͠ϧʔϧηοτ stylelint-config-standard ͕͋
    Δ

    View full-size slide

  18. ·ͱΊ
    • ίʔσΟϯάΨΠυΛऔΓೖΕͯɺHTML/
    CSSΛهड़͢ΔϧʔϧΛ࡞Ζ͏
    • ͞ΒʹɺStylelint Λಋೖͯ͠ίʔυ඼࣭Λ޲
    ্ͤ͞Α͏

    View full-size slide

  19. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ

    View full-size slide