React沼CSSArchitect
by
8845musign
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
@8845musign React Numa CSS Architect
Slide 2
Slide 2 text
ෲےϩʔϥʔͷྗΛ৴͡Ζ @8845musign
Slide 3
Slide 3 text
Anova Frontend Engineer
Slide 4
Slide 4 text
Anova Frontend Engineer ϩʔετϏʔϑΛ࡞͖ͬͯ·ͨ͠ʂʂʂ
Slide 5
Slide 5 text
No content
Slide 6
Slide 6 text
σϞϯετϨʔγϣϯ͚6* ࢼ༻ظؒʹ͖߱ͬͯͨ
Slide 7
Slide 7 text
6*ϚʔΫΞοϓಘҙʂ Ϙλϯ ϓϧμϯ
Slide 8
Slide 8 text
6*ͳΒ͓ͯͷͷ Ϙλϯ ϓϧμϯ śŘʙŕţʙʂʂʂ ͔͠͠ɺ͍ͭ͜Β͕͍ͨ śŨŜƀŕţʙʂ
Slide 9
Slide 9 text
ࢥͬͨҎ্ʹεϐʔυͰͳ͍ʜ
Slide 10
Slide 10 text
পʹ·ͬͨɺͨͬͨ̐ͭͷεςοϓ
Slide 11
Slide 11 text
ऴɹΘɹͬɹͨɹʁ ⾫ґཔओ
Slide 12
Slide 12 text
ґཔओ͕͜Ε͔͠ݴΘͳ͘ͳͬͨ ※ωλͰ͢
Slide 13
Slide 13 text
$44ͷίϯϙʔωϯτΛΔલʹ ΅͘ͷΫϏ͕ΒΕͦ͏ ※͕͢͞ʹωλͰ͢
Slide 14
Slide 14 text
1 ͦ͜ʹنͳ͍̍ຕͷେͳ4BTT͕͕͍ͬͯͨɻপͩͬͨ ࠷ޙʹ$44+4ίϯϙʔωϯτཻͷপ͕͍ͬͯͨ ࣍ʹίϯύΠϧεϐʔυͷপʹΛऔΒΕͨ ϓϩδΣΫτʹ·ͣ3FBDU͕͋ͬͨɺ3FBDU্Ͱॻ͖ग़ͨ͠ 2 3 4
Slide 15
Slide 15 text
$44ͷίϯϙʔωϯτΛΔલʹ ΅͘ͷΫϏ͕ΒΕͦ͏ ࢼ༻ظ͚ؒͩͳΜͱ͔ΓΕʂʂʂʂ ※ωλͰͬͯ͢ʂʂʂ
Slide 16
Slide 16 text
$44ઃܭ ίʔσΟϯάڥ ̎ͭͷଆ໘͔ΒվળΛ͢Δ
Slide 17
Slide 17 text
$44ઃܭ
Slide 18
Slide 18 text
Ͳ͜ʹ࡞༻͢Δ͔Λ໌֬ʹ͍ͨ͠
Slide 19
Slide 19 text
ٕज़తʹ$44Λղܾ͢ΔΞϓϩʔν
Slide 20
Slide 20 text
طଘͷ4BTT͔ΒͷҠߦʁ ֶशίετ͕͔͔Γͦ͏ අ༻ରޮՌʁ νʔϜશһ͕͍ͭ͑ΔΑ͏ʹͳΔʁ
Slide 21
Slide 21 text
ઃܭʹΑΔΞϓϩʔν https://en.bem.info/
Slide 22
Slide 22 text
1 ಛఆͷٕज़ʹϩοΫΠϯ͞Εͳ͍ ωετΛపఈతʹഉআ͢Δɺͱ͍͏ࢥૉΒ͍͠ Ϋϥε໊Λߟ͑Δ͜ͱ͕͍͠ 1 2 Good Bad
Slide 23
Slide 23 text
πʔϧઃܭΛղܾͯ͘͠Εͳ͍
Slide 24
Slide 24 text
୯७Ͱ୭ͰཧղͰ͖Δઃܭ $44ʢ4BTTʣͱXFCQBDLͷMPBEFS͚ͩͰ
Slide 25
Slide 25 text
͖Ίͨ͜ͱ
Slide 26
Slide 26 text
%JSFDUPSZϕʔεͷΫϥε໋໊ SomeComponent !"" ChildA !"" ChildB #"" childB.scss #"" childB.js !"" list.scss .some-component-child-a-child-b-list
Slide 27
Slide 27 text
͍Ϋϥε໊ͷղܾ const CSS_ROOT = ‘some-component-child-a-child-b-list'; class List extends Component { render() { return
} }
Slide 28
Slide 28 text
͍Ϋϥε໊ͷղܾ .some-component-child-a-child-b-list { &__item { … } &__button { … } … } BlockΛলུ͢Δ ͨΊ͚ͩͷωετ
Slide 29
Slide 29 text
1 ίϯϑϦΫτ΄΅ͳ͍ Ϋϥε໊͔ΒσΟϨΫτϦΛ͏ͷ͕༰қ ͍ͩ͞ʜ 1 2 Good Bad
Slide 30
Slide 30 text
ίϯϙʔωϯτͷཻ +4ͱ$44Ͱ͕جຊʢྫ֎͋Δʣ
Slide 31
Slide 31 text
ίϯϙʔωϯτͷཻ +4ͷ߹ʹ߹ΘͤͯίϯϙʔωϯτΛׂ
Slide 32
Slide 32 text
ྫ͑5BCMF head head head head body body body body body body body body body body body body body body body body body body body body body body body body
Slide 33
Slide 33 text
ྫ͑5BCMF head head head head body body body body body body body body body body body body body body body body body body body body body body body body
Slide 34
Slide 34 text
+4ʹΜΘΓͻΕ෬͢ MPPQͯ͠SFOEFS͢ΔUSͰίϯϙʔωϯτΛΔ QSPQTόέπϦϨʔͷΕΛҙࣝ͢Δ͜ͱͰ ύϑΥʔϚϯενϡʔχϯά͕͘͢͠ͳΔར )5.-$44ͷ߹Ͱ͚ͩͰίϯϙʔωϯτͬͯɺ͏͔ͬΓ +4࣮࣌ʹελΠϧ͕+4ίϯϙʔωϯτʹΑͬͯஅ͞ΕΔͱਏ͍
Slide 35
Slide 35 text
)5.-ϚʔΫΞοϓͱ+4ίʔσΟϯά Ͱࣄલ͢Γ߹ΘͤΛ͠ͱ͘ͱͤ
Slide 36
Slide 36 text
JNQPSUϧʔϧ $PNQPOFOUͰ҉తʹJNQPSU͞Εͨ$44ͷదԠΛېࢭ͢Δ ໌ࣔతʹJNQPSUͨ͠$44ͷΈదԠՄೳͱ͢Δ +4ͱ$44ͷͰରԠ͢Δ$44Ҏ֎ɺϞδϡʔϧ͘͠ γεςϜڞ௨$44ͷΈಡΈࠐΜͰྑ͍ 1 2
Slide 37
Slide 37 text
҉తͳJNQPSUͷېࢭ Component #"" ChildComponent $ #"" child.scss $ !"" child.js #"" index.scss !"" index.js
Slide 38
Slide 38 text
҉తͳJNQPSUͷېࢭ Component #"" ChildComponent $ #"" child.scss $ !"" child.js #"" sharedComponent.scss #"" index.scss !"" index.js ڞ௨ελΠϧͷநग़
Slide 39
Slide 39 text
JNQPSUՄೳൣғ Component #"" ChildComponentA $ #"" childA.scss $ !"" childA.js #"" ChildComponentB $ #"" childB.scss $ !"" childB.scss #"" index.scss !"" index.js ໌ࣔతͰېࢭ
Slide 40
Slide 40 text
JNQPSU͔ΒదԠελΠϧ͕ Θ͔Δঢ়ଶΛݎक͢Δ
Slide 41
Slide 41 text
ωετېࢭ .some-class tr td {} .some-class__list__btn {} ཁૉ͘͠ΫϥεʹΑΔωετ #&.ͰͷΤϨϝϯτಉ࢜ͷωετ ωετͷൃੜίϯϙʔωϯτׂͷαΠϯ
Slide 42
Slide 42 text
ωετېࢭ .some-class tr td {} .some-class__list__btn {} ཁૉ͘͠ΫϥεʹΑΔωετ #&.ͰͷΤϨϝϯτಉ࢜ͷωετ ωετͷൃੜίϯϙʔωϯτׂͷαΠϯ .some-class__list-btnΞϦ
Slide 43
Slide 43 text
୭ͰΘ͔Δϧʔϧਁಁ͍͢͠
Slide 44
Slide 44 text
ίʔσΟϯάڥ
Slide 45
Slide 45 text
#SPXTFS4ZOD࣌ͷ ɹരNTͦͦ͜͜ͷMJWFSFMPBEͱൺ
Slide 46
Slide 46 text
XXXXXXFCQBDLʜ
Slide 47
Slide 47 text
͍ XFCQBDL ͍
Slide 48
Slide 48 text
No content
Slide 49
Slide 49 text
IUUQTHJUIVCDPNTUPSZCPPLTTUPSZCPPL
Slide 50
Slide 50 text
ίϯϙʔωϯτ୯ҐͰ۠ΒΕͨ αϯυϘοΫε։ൃڥ
Slide 51
Slide 51 text
No content
Slide 52
Slide 52 text
γϯϓϧͳϏϧυઃఆ͕దԠ͞ΕΔɺ͍ ࣗવͱίϯϙʔωϯτ୯ҐͰͷίʔσΟϯά͕ཁٻ͞ΕΔ ίϯϙʔωϯτཆΪϓε ผ్ɺઐ༻4UPSZΛهड़ͨ͠+4ϑΝΠϧΛ༻ҙඞཁ͕͋Δ 1 Good Bad υΩϡϝϯςʔγϣϯπʔϧͱͯ͠ΈΔͱඪ४ػೳ͔ͳΓශऑ ΠϕϯτͷൃՐهड़Ͱ͖Δ 2 3 1 2
Slide 53
Slide 53 text
Ϗϧυ͕࣌ؒ T͔ΒʙTఔͷվળ ˞ͦͦͷݩͷXFCQBDLઃఆʹվળͷ༨͕͋Δ͔͠Εͳ͍͕
Slide 54
Slide 54 text
4UPSZͷهड़ import React from ‘react'; import { storiesOf, action } from '@kadira/storybook'; import Button from ‘../components/Button'; storiesOf('Button', module) .add('with text', () => ( Hello Button ));
Slide 55
Slide 55 text
TTTTTTTTTTTTTTTTUPSZʜ
Slide 56
Slide 56 text
໘ ໘ TUPSZ
Slide 57
Slide 57 text
> yo project:story śŕţ
Slide 58
Slide 58 text
ՃBEEPO TUPSZCPPLTSFBDUTUPSZCPPLBEEPOJOGP આ໌จͷϖʔδͷهड़ɺαϯϓϧίʔυ QSPQTҰཡΛࣗಈੜ͕Մೳ UVDILTUPSZCPPLSFBENF NBSLEPXOܗࣜͷ3&"%.&ϑΝΠϧΛදࣔ 1 2
Slide 59
Slide 59 text
ࠔΓࣄ ϝχϡʔͷ֊Խ͕Ͱ͖ͣɺ໊લͷ͚ํ ̍ϖʔδʹෳ4UPSZΛهड़͢ΔͳͲͰରԠʜ
Slide 60
Slide 60 text
ࠔΓࣄ ϝχϡʔͷ֊Խ͕Ͱ͖ͣɺ໊લͷ͚ํ ̍ϖʔδʹෳ4UPSZΛهड़͢ΔͳͲͰରԠʜ ୭͔ڭ͍͑ͯͩ͘͞ʂ
Slide 61
Slide 61 text
$44ઃܭ ίʔσΟϯάڥ ໎Θͳ͍ ໌֬ͳϧʔϧઃఆ ࣮εϐʔυΛམͱ͞ͳ͍ շదͳڥͷٻ
Slide 62
Slide 62 text
⾫ґཔओ
Slide 63
Slide 63 text
͋Μ͠Μ
Slide 64
Slide 64 text
ࠓޙͷ53:
Slide 65
Slide 65 text
4UZMF(VJEFӡ༻ϑϩʔͷཱ֬
Slide 66
Slide 66 text
4UZMF(VJEF 4UPSZCPPLΛ͏ 3FBDUίϯϙʔωϯτΧλϩάͱσβΠϯΨΠυϥΠϯΛ౷߹ ΤϯδχΞ͔ΒσβΠφʔɺϓϩδΣΫτʹؔΘΔਓͯ͢ʹ ͱͬͯՁͷ͋Δͷͱ͢Δ
Slide 67
Slide 67 text
Build Design ΤϯδχΞ σβΠφʔ
Slide 68
Slide 68 text
Build Design ΤϯδχΞ σβΠφʔ HJUQVTI
Slide 69
Slide 69 text
Build Design ΤϯδχΞ σβΠφʔ HJUQVTI +FOLJOTͰ੩తϏϧυ
Slide 70
Slide 70 text
Build Design ΤϯδχΞ σβΠφʔ HJUQVTI +FOLJOTͰ੩తϏϧυ #PPLΛνΣοΫͭͭ͠ σβΠϯ
Slide 71
Slide 71 text
Build Design ΤϯδχΞ σβΠφʔ HJUQVTI +FOLJOTͰ੩తϏϧυ #PPLΛνΣοΫͭͭ͠ σβΠϯ σβΠϯΛίʔσΟϯά ͭͭ͠ΨΠυԽ
Slide 72
Slide 72 text
Build Design ΤϯδχΞ σβΠφʔ HJUQVTI +FOLJOTͰ੩తϏϧυ #PPLΛνΣοΫͭͭ͠ σβΠϯ σβΠϯΛίʔσΟϯά ͭͭ͠ΨΠυԽ ҰఆظؒͷΠςϨʔγϣϯͰ܁Γฦ͢
Slide 73
Slide 73 text
Build Design ΤϯδχΞ σβΠφʔ ٕज़తͳোͰ͖Δ͜ͱ Λ͍͑ͯ͘ σβΠϯͷ๏ଇੑ ίϯϙʔωϯτΛൃݟ ྫ͑Ϛʔδϯ୯ҐΑ͘ΘΕΔ৭ͳͲ
Slide 74
Slide 74 text
Build Design ΤϯδχΞ σβΠφʔ ϒϥϯσΟϯάؚΊΑΓ େ͖ͳࢹ͔ΒͷνΣοΫ
Slide 75
Slide 75 text
Build Design ΤϯδχΞ σβΠφʔ ϒϥϯσΟϯάؚΊΑΓ େ͖ͳࢹ͔ΒͷνΣοΫ ίϛϡχέʔγϣϯϋϒ
Slide 76
Slide 76 text
4UZMF(VJEFΛͬͯ౸ୡ͍ͨ͠Ϩϕϧ
Slide 77
Slide 77 text
σβΠφʔͷηϯεΛ໌Β͔ʹͯ͠ ϊϯσβΠφʔσβΠϯʹࢀՃͰ͖Δ
Slide 78
Slide 78 text
σβΠϯΛεΩϧͱͯ͠ଊ͑Δ
Slide 79
Slide 79 text
ͨ·ʹ ΤϯδχΞσβΠϯͯ͠ΈΔτΧ
Slide 80
Slide 80 text
Atomic Design Ebook ϞδϡʔϧࢦͷσβΠϯ ΫϥΠΞϯτɾ৫ͷઆಘ ӡ༻ϑϩʔͷߏங σβΠϯγεςϜͷ༗ޮੑ
Slide 81
Slide 81 text
Atomic Design Ebook ϞδϡʔϧࢦͷσβΠϯ ΫϥΠΞϯτɾ৫ͷઆಘ ӡ༻ϑϩʔͷߏங σβΠϯγεςϜͷ༗ޮੑ
Slide 82
Slide 82 text
Atomic Design Ebook ϞδϡʔϧࢦͷσβΠϯ ΫϥΠΞϯτɾ৫ͷઆಘ ӡ༻ϑϩʔͷߏங σβΠϯγεςϜͷ༗ޮੑ Ϟδϡʔϧ͝ͱʹϑΥʔΧεͯ͠ධՁ͢Δ ·ͣԿ͕ඒ͍͠ͷ͔ʁΛΫϥΠΞϯτͱͭΊΔ
Slide 83
Slide 83 text
http://atomicdesign.bradfrost.com/chapter-2/
Slide 84
Slide 84 text
http://atomicdesign.bradfrost.com/chapter-2/ ཻͷ͋Μ·͠ࡌͬͯͳ͍
Slide 85
Slide 85 text
http://atomicdesign.bradfrost.com/chapter-2/ atomic design is not rigid dogma - Brad Forst
Slide 86
Slide 86 text
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠