Slide 1

Slide 1 text

HTML5 ͱ͔ษڧձ #27 2012/03/13 less for Web Designer ੪౻༞໵@CSS Radar

Slide 2

Slide 2 text

੪౻༞໵ http://css.studiomohawk.com http://newsletter.studiomohawk.com CSS Radar CSS Radar Newsletter

Slide 3

Slide 3 text

੪౻༞໵ @cssradar Cyber Agent

Slide 4

Slide 4 text

-&44ͱ͸ γϯλοΫε -&44Ͱͭ͘Δࣗ෼ͷ#PJMFSQMBUF -&44Λ࢖ͬͨϑϨʔϜϫʔΫɺ ίϨΫγϣϯ -&44Λ࢖ͬͨϓϩτλΠϓ࡞੒ϫʔΫϑϩʔ Agenda

Slide 5

Slide 5 text

LESSͰ͸ม਺ɺ ϛοΫεΠϯɺ ೖΕࢠϧʔϧɺ ࢛ଇ ԋࢉͱؔ਺ͳͲΛCSSʹ௥Ճ͢Δ͜ͱ͕Ͱ͖· ͢ɻ ϓϩύςΟ΍ηϨΫλͷ֦ு͸͋ͬͯ΋ݴޠͦͷ ΋ͷʹେ͖͘มԽ͕ͳ͍CSSʹμΠφϛοΫͳε λΠϧγʔτΛ࡞੒Ͱ͖ΔػೳΛ௥Ճ͢Δͷ͕ LESSͰ͢ɻ lessͱ͸

Slide 6

Slide 6 text

- LESS / JavaScript (node.js) → CSSʹݶΓͳ͍ۙ͘͠จ๏Ͱॻ͔Ε͍ͯΔ - Sass / Ruby → ߴػೳɻ Compassɺ BourbonͳͲ͸ศར - Stylus / node.js → ΫϦʔϯͳจ๏ɺ Τϥʔจ͸लҳ lessͱ͸

Slide 7

Slide 7 text

-&44͸OPEFKTɺ ͭ·Γ+BWB4DSJQUΛ࢖ͬͯ࡞੒ ͞Ε͍ͯ·͢ɻ ϒϥ΢β͔ΒͰ΋ར༻͢Δ͜ͱ͕Ͱ͖·͕͢ɺ ࠷ۙ Ͱ͸-&44BQQɺ 8JO-&44ɺ 4JNQ-&44ɺ $PEF,JU ͳͲͷ(6*ΞϓϦέʔγϣϯΛ࢖ͬͯ$44΁ͷม ׵Λߦ͏ϫʔΫϑϩʔͷ΄͏͕Ұൠతʹͳ͖ͬͯ ͍ͯ·͢ɻ lessͱ͸

Slide 8

Slide 8 text

Syntax

Slide 9

Slide 9 text

γϯλοΫεม਺ @ม਺໊: ஋; @color: #4D926F; @font-size: 16px; @strings: “/path/to/image/”; @ver: @foo;

Slide 10

Slide 10 text

γϯλοΫεϛοΫεΠϯ .class ·ͨ͸ #id { property: value; } ྫ .center-block { display: block; margin-left: auto; margin-right: auto; }

Slide 11

Slide 11 text

γϯλοΫεೖΕࢠϧʔϧ #header { h1 { font-size: 26px; font-weight: bold; } p { font-size: 12px; a { text-decoration: none; &:hover { border-width: 1px; } } } }

Slide 12

Slide 12 text

γϯλοΫεԋࢉ @base: 5%; @filler: @base * 2; @other: @base + @filler; .selector { color: #888 / 4; background-color: @base-color + #111; height: 100% / 2 + @filler; }

Slide 13

Slide 13 text

γϯλοΫεؔ਺ lighten(@color, 10%); darken(@color, 10%); saturate(@color, 10%); desaturate(@color, 10%); fadein(@color, 10%); fadeout(@color, 10%); fade(@color, 50%); spin(@color, 10); spin(@color, -10); mix(@color1, @color2);

Slide 14

Slide 14 text

γϯλοΫευΩϡϝϯτ http://lesscss.org/ http://less-ja.studiomohawk.com/ "MFYJT4FMMJFSࢯͷྃղΛ͑ͯɺ ࢲ͕೔ຊޠ༁ͨ͠υΩϡϝϯτ͕͋Γ·͢ɻ ৄࡉʹ͍ͭͯ͸ͦͪΒΛࢀর͍ͩ͘͞ɻ

Slide 15

Slide 15 text

Boilerplate

Slide 16

Slide 16 text

boil·er·plate [boi-ler-pleyt] noun 1. plating of iron or steel for making the shells of boilers,covering the hulls of ships, etc. 2. Journalism . ! a. syndicated or ready-to-print copy, used especially by weekly newspapers. ! b. trite, hackneyed writing. 3. the detailed standard wording of a contract, warranty, etc. 4. Informal . phrases or units of text used repeatedly, as in correspondence produced by a word-processing system. 5. frozen, crusty, hard-packed snow, often with icy patches. Boilerplate

Slide 17

Slide 17 text

bootstrap [ˈbuːtˌstræp] noun 1. A loop (leather or other material) sewn at the side or top rear of a boot to help in pulling the boot on. 2. A means of advancing oneself or accomplishing something without aid. He used his business experience as a bootstrap to win voters. (computing) The process by which the operating system of a computer is loaded into its memory 3. (computing) The process necessary to compile the tools that will be used to compile the rest of the system or program. 4. (statistics) Any method or instance of estimating properties of an estimator (such as its variance) by measuring those properties when sampling from an approximating distribution. Boilerplate

Slide 18

Slide 18 text

࠶ར༻͕Մೳͳίʔυू -&44ʹ͸ม਺ɺ ϛοΫεΠϯͷΑ͏ͳ࠶ར༻Λલ ఏͱͨ͠ػೳ͕͋ΔͷͰɺ ͜ͷػೳΛར༻ͯࣗ͠෼ ͷ#PJMFSQMBUF#PPUTUSBQΛߏங͍ͯ͘͜͠ͱͰॳ ظίετΛ͛͞Δ͜ͱ͕Ͱ͖·͢ɻ Boilerplate

Slide 19

Slide 19 text

$44ϑϨʔϜϫʔΫ͸ҧ͏ʁ HT΍CMVFQSJOUͳͲʹ୅ද͞ΕΔ$44ϑϨʔ ϜϫʔΫ͸$44͚ͩͰ͸ͳ͘)5.-ʹ΋ࢦఆͷΫ ϥε໊Λར༻͢Δඞཁ͕͋Γ·ͨ͠ɻ -&44΍4BTTͷม਺΍ϛοΫεΠϯΛར༻͢Ε ͹ɺطଘͷ)5.-Λมߋ͠ͳͯ͘΋άϦουͷੜ ੒΍ɺλΠϙάϥϑΟͷઃఆɺΧϥʔεΩʔϜͷ มߋͳͲΛߦ͑·͢ɻ Boilerplate

Slide 20

Slide 20 text

http://www.slideshare.net/collylogic/developing-your-ultimate-package Boilerplate

Slide 21

Slide 21 text

http://html5boilerplate.com/ Boilerplate

Slide 22

Slide 22 text

http://24ways.org/2011/front-end-style-guides Boilerplate

Slide 23

Slide 23 text

http://24ways.org/2011/crafting-the-front-end Boilerplate

Slide 24

Slide 24 text

http://github.com/studiomohawk/IIT Boilerplate / IIT

Slide 25

Slide 25 text

ͦΕͧΕͷιʔείʔυΛϕʔεʹগͣͭ͠खΛՃ͑ͯɺ ࣗ෼Β͍͠#PJMFSQMBUFΛҭ͍ͯͯ·͢ɻ )5.-ɺ$44ɺ+4ͱ͍͏πʔϧ͸ࣗ෼͕࢖͍΍͍༷͢ʹ खೖΕ͢Δɻ -&44͸ͦͷ͓खೖΕͷख఻͍Λͯ͘͠ΕΔͷʹ࠷దͳ πʔϧɻ Boilerplate / IIT

Slide 26

Slide 26 text

Boilerplate / IIT

Slide 27

Slide 27 text

Boilerplate / IIT

Slide 28

Slide 28 text

Boilerplate / IIT

Slide 29

Slide 29 text

DMFBSpY/JDPMBT(BMMBHIFS ΧϥʔύϨοτBOEVQCZ"OEZ$MBSL ϔϧύπʔϧ)5.-#PJMFSQMBUF ϝσΟΞΫΤϦBOEVQCZ"OEZ$MBSL OPSNBMJ[FDTT/JDPMBT(BMMBHIFS 00$44/JDPMF4VMMJWBO λΠϙάϥϑΟʔ)BSSZ3PCFSUT ϑΥϯτϑΝϛϦʔDTTGPOUTUBDLDPN άϦουγεςϜ'SBNFMFTTCZ+POJ,PSQJ $44-&44$44.JYJOTCZ.BUUIFX8BHFSpFME Boilerplate / IIT

Slide 30

Slide 30 text

Framework/Collection

Slide 31

Slide 31 text

#PPUTUSBQ 5XJUUFS Framework/Collection

Slide 32

Slide 32 text

#PPUTUSBQ 5XJUUFS ެ։͞Ε͍ͯΔ΋ͷͰ͸࠷େڃͷ-&44ར༻౓ ϑϨʔϜϫʔΫͱ͍͏ΑΓ͸σβΠϯύοέʔδ ͔ΒϨεϙϯγϒσβΠϯʹରԠ ৄ͘͠͸͜ͷޙͷൃදͰ Framework/Collection

Slide 33

Slide 33 text

1SFCPPUMFTT Framework/Collection

Slide 34

Slide 34 text

#PPUTUSBQ 'SPN5XJUUFSͷݪܕ -&44͕ެ։͞Εͨޙ͙͢ʹެ։͞Εͨઌۦऀ ͷϛοΫεΠϯɺ ͭͷม਺ͷίϨΫγϣϯ ϕʔγοΫͳ-&44ͷιʔεΛֶͿʹ࠷ద 1SFCPPUMFTT Framework/Collection

Slide 35

Slide 35 text

-&44&MFNFOUT Framework/Collection

Slide 36

Slide 36 text

1SFCPPUMFTTͱಉ࣌ظʹެ։͞Εͨ !JNQPSU͚ͩͰݺͼग़ͤΔؾܰ͞Λ঺հ ͷϛοΫεΠϯͷίϨΫγϣϯ ϕʔγοΫͳ-&44ͷιʔεΛֶͿʹ࠷ద -&44&MFNFOUT Framework/Collection

Slide 37

Slide 37 text

BOEVQ Framework/Collection

Slide 38

Slide 38 text

ϞόΠϧϑΝʔετΞϓϩʔνͷ)5.-#PJMFSQMBUF "OEZ$MBSLFࢯ࡞ )BSECPJMFE8FC%FTJHOͷஶऀ $MBSLFࢯߟҊͷΧϥʔύϨοτ༻ม਺͸ศར ݩʑ͸$44ϕʔεͩͬͨͷΛ-&44ʹίϯόʔτ BOEVQ Framework/Collection

Slide 39

Slide 39 text

5IF4FNBOUJD(SJE4ZTUFN Framework/Collection

Slide 40

Slide 40 text

Ϩεϙϯγϒݻఆ෯྆ํ࢖͑ΔάϦουγεςϜ ط੒ͷΫϥε໊ʹཔΒͳ͍ͱ͍͏ҙຯͰηϚϯςΟΫ article { .column(12); } Ϩεϙϯγϒ άϦουγεςϜͷߏங͕ͱͯ΋ָ 5IF4FNBOUJD(SJE4ZTUFN Framework/Collection

Slide 41

Slide 41 text

'3".&-&44 Framework/Collection

Slide 42

Slide 42 text

άϦουαΠζΛݻఆʹ͢Δ৽͍͠Ϩεϙϯγϒ άϦουͷ௥Ճ͸खಈ άϦου਺͸΢Οϯυ΢ͷαΠζʹΑͬͯมԽ͢Δ ඞཁͳ෦෼͚ͩൈ͖ग़ͯ͠࢖ͬͯ·͢ 4BTT൛΋͋Δ '3".&-&44 Framework/Collection

Slide 43

Slide 43 text

(SJEQBL Framework/Collection

Slide 44

Slide 44 text

ϨεϙϯγϒάϦουΛΧελϚΠζ ΨΠυ༻ͷഎܠɺ -&44ɺ +4ɺ $44ɺ 4BTTΛੜ੒ ͲΜͳϓϩδΣΫτʹͰ΋ରԠͰ͖Δ෯ͷ޿͞ ΢Σϒπʔϧ (SJEQBL Framework/Collection

Slide 45

Slide 45 text

-&44$44.JYJOT Framework/Collection

Slide 46

Slide 46 text

$44ʹಛԽͨ͠ϛοΫεΠϯू ΄΅શͯͷ$44ͷϓϩύςΟΛ໢ཏ ݺͼग़͠ΛߦΘͳ͚Ε͹$44ʹ͸ॻ͖ग़͞ͳ͍ ϛοΫεΠϯͷఆٛͷํ๏ͰมΘΓ·͢ DVCJDCF[JFS FBTJOH ͷม਺͸लҳ -&44$44.JYJOT Framework/Collection

Slide 47

Slide 47 text

঺հͨ͠΄΅͢΂ͯͷϦϙδτϦΛू໿ ݸਓతͳݟղͰ ศརͳ෦෼͚ͩΛબ୒ υΩϡϝϯτ෇͖ ະ࣮૷ ίϥϘϨʔλ͸͍ͭͰ΋ืूͯ͠·͢ **5 Framework/Collection

Slide 48

Slide 48 text

Prototyping

Slide 49

Slide 49 text

Prototying “Design isn’t just how it looks, Design is how it works” Steve Jobs

Slide 50

Slide 50 text

Prototying Water Fall Ajile Lean UX "KJMF࣌୅ͷܰྔ69

Slide 51

Slide 51 text

ཁٻ Ϗδωεΰʔϧ ৄࡉ࢓༷ ։ൃ σβΠϯίʔσΟϯά ཁٻϕʔεͷ։ൃϑϩʔ Prototying

Slide 52

Slide 52 text

֓ཁཁٻ Ϗδωεΰʔϧ ৄࡉ࢓༷ ։ൃ ίϯηϓτσβΠϯ ϓϩτλΠϓ ϓϩτλΠϓ͔Β࢓༷ΛৄࡉԽ͍ͯ͘͠ Prototying

Slide 53

Slide 53 text

ίϛϡχέʔγϣϯͷ૒ํ޲ੑ ໨ʹݟ͑Δ࣮ࡍʹಈ࡞͢ΔϓϩτλΠϓ ϑΟʔυόοΫमਖ਼ ܁Γฦ͠ ৄࡉ࢓༷ʹམͱ͍ͯ͘͠ Prototying

Slide 54

Slide 54 text

ίϯηϓτΛܗʹ /FFET8BOUTΛ఻ୡ͢ΔͨΊͷϏδϡΞϥΠζ ։ൃʹର͢Δ໰୊ղܾ΋σβΠϯͰఏҊ͠΍͘͢ͳΔ )5.-$44+4Ͱ࡞ΔϓϩτλΠϓ͸ͦͷҰॿ ͱͳΔσβΠϯπʔϧ Prototying

Slide 55

Slide 55 text

Ͱ΋ɺ ίʔσΟϯά͸΍ͬͺΓ͕͔͔࣌ؒΔ +BWB4DSJQU͸K2VFSZΛಘͯɺ $44͸Ϟμϯϒϥ΢βͱ$44ͱ ͦͯ͠-&44Λಘ·ͨ͠ɻ ϋΠϑΟσΟϦςΟͰɺ ΠϯλϥΫςΟϒͳ ϓϩτλΠϓ͸ܾͯ͠೉͘͠ͳ͍Ͱ͢ɻ Prototying ? !

Slide 56

Slide 56 text

#PPUTUSBQ 'SPN5XJUUFS IUUQUXJUUFSHJUIVCDPNCPPUTUSBQ 'PVOEBUJPOCZ;63# -&44WFS΋͋Δ IUUQGPVOEBUJPO[VSCDPN #MPDLTCZ&JHIU4IBQFT ઈࢍ੡࡞தΒ͍͠ IUUQTHJUIVCDPN&JHIU4IBQFT#MPDLT )5.-$44+4ϓϩτλΠϓϑϨʔϜϫʔΫ Prototying

Slide 57

Slide 57 text

ࢲ΋**5ΛϕʔεʹϓϩτλΠϓ ϑϨʔϜϫʔΫΛ࡞੒༧ఆͰ͢ɻ Prototying

Slide 58

Slide 58 text

Finally..

Slide 59

Slide 59 text

Design is for solving problems. But Don’t try to solve wrong problems.

Slide 60

Slide 60 text

Our use of Less is a stopgap while we wait for the future of CSS – which is looking really promising and already has great proposals for variables and mixins! For now however, we’re really happy with Less – but don’t think you should have to use it if it’s not your thing. Jacob Thornton A.K.A fat