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

WordPressでCSSプリプロセッサ入門

 WordPressでCSSプリプロセッサ入門

2014/03/29 WordBench東京 春のデザイナー祭り!のスライドです。
https://wbtokyo.doorkeeper.jp/events/9652

Avatar for sou-lab

sou-lab

March 29, 2014

More Decks by sou-lab

Other Decks in Programming

Transcript

  1. 一行コメント .site-header { background-color: #000; //max-width: 1260px; position: relative; width:

    100%; z-index: 4; } .header-main { min-height: 48px; //padding: 0 10px; } 地味に便利
  2. とあるテーマファイル /* Theme Name: Hoge Theme Theme URI: http://hoge.com/ Author:

    hogeyama */ ダメよ〜 ! @import url('common.css'); @import url('module.css'); @import url('style.css'); @import url('print.css'); ダメダメ
  3. @for for文で繰り返し @for $i from 1 through 10 { ループは他にも

    .mb-#{$i*10} { @whileや@eachも margin-bottom: #{$i*10}px; あるんだ } }
  4. @for コンパイルすると... .mb-10 { margin-bottom: 10px; } .mb-20 { margin-bottom:

    20px; } .mb-30 { margin-bottom: 30px; } .mb-40 { margin-bottom: 40px; } .mb-50 { margin-bottom: 50px; } .mb-60 { margin-bottom: 60px; } .mb-70 { margin-bottom: 70px; } .mb-80 { margin-bottom: 80px; } .mb-90 { margin-bottom: 90px; } .mb-100 { margin-bottom: 100px; }