Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
モダンなJavaScriptアプリケーションでモダンにスタイリングする方法
Search
sota ohara
January 24, 2018
Programming
9
4.9k
モダンなJavaScriptアプリケーションでモダンにスタイリングする方法
WeAreJavaScripters@15th
https://wajs.connpass.com/event/76238/
sota ohara
January 24, 2018
Tweet
Share
More Decks by sota ohara
See All by sota ohara
Re-Architecture of ReactNative
sottar
0
180
Implement prerendering w/ puppeteer
sottar
1
210
create own CMS from scratch
sottar
2
8.8k
Let’s try to hack AST of JavaScript
sottar
1
1.6k
フロントエンドエンジニアが伝えたい最近の事情
sottar
28
18k
複数人で高速に開発するためのnpmモジュール
sottar
5
2.5k
new version of context in React 16.3
sottar
3
1.6k
2ヶ月半でサービスをリリースした話し
sottar
2
2.1k
Redux のディレクトリ構成を考える
sottar
2
14k
Other Decks in Programming
See All in Programming
フロントエンドの現在地とこれから
koba04
10
4.4k
GitHub Copilot Workspace で我々のアプリ開発がどう変わるのか?
shuyakinjo
0
890
RDBの世界をぬりかえていくモデルグラフDB〜truncus graphによるモデルファースト開発〜
jurabi
0
170
Removing Corepack
yosuke_furukawa
PRO
9
1.2k
ROS 2のZenoh対応とZenohのROS 2対応
takasehideki
2
290
Делим тесты между QA и разработчиком
mariyasaygina
0
540
ACES Meet におけるリリース作業改善の取り組み
fukucheee
0
130
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
370
Go製CLIツールGatling Commanderによる負荷試験実施の自動化
okmtz
3
690
文化が生産性を作る
jimpei
3
550
2024-10-01 dev2next - Observability for Modern JVM Applications
jonatan_ivanov
0
110
DjangoNinjaで高速なAPI開発を実現する
masaya00
0
500
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
49
7.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.5k
Producing Creativity
orderedlist
PRO
341
39k
What's new in Ruby 2.0
geeforr
341
31k
Why Our Code Smells
bkeepers
PRO
334
57k
A designer walks into a library…
pauljervisheath
202
24k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
3
230
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
46
4.9k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
25
660
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.3k
Building Adaptive Systems
keathley
38
2.1k
Transcript
ϞμϯͳJavaScriptΞϓϦέʔγϣϯͰ ϞμϯʹελΠϦϯά͢Δํ๏ גࣜձࣾϝϧΧϦ ϑϩϯτΤϯυΤϯδχΞ େݪᆴଠ
վΊɻɻ
React ͰϞμϯʹελΠϦϯά͢Δํ๏ גࣜձࣾϝϧΧϦ ϑϩϯτΤϯυΤϯδχΞ େݪᆴଠ
େݪ ᆴଠ / sottar גࣜձࣾϝϧΧϦ ϑϩϯτΤϯυΤϯδχΞ mercari NOW, CSTool sottar_
About me sottar
React Ͱ CSSɺͲ͏ͬͯॻ͍ͯ·͔͢ʁ
ελΠϦϯά͢ΔࡍʹٻΊΔͷ
ελΠϦϯά͢ΔࡍʹٻΊΔͷ - component ͝ͱʹείʔϓΛΓ͍ͨ - ͦͷελΠϧ͕Ͳ͜ͰΘΕ͍ͯΔ͔Γ͍ͨ - CSS ͱ JS
ͰΛڞ༗͍ͨ͠ - ΤσΟλͷγϯλοΫεϋΠϥΠτิػೳ͕͍͍ͨ - ඪ४ͷCSSͱಉ͡γϯλοΫεͰॻ͖͍ͨ - stylelint ͍͍ͨ - ಛఆͷπʔϧΛΘͳͯ͘ JS ͷΤϥʔ͕ు͔Εͳ͍
ελΠϦϯάͷํ๏ - CSS Modules - CSS in JS - ී௨ʹCSSΛॻ͘
ʢBEMͳͲͰʣ
ελΠϦϯάͷํ๏ - CSS Modules - CSS in JS - ී௨ʹCSSΛॻ͘
ʢBEMͳͲͰʣ
CSS in JS (template literal)
CSS in JS ͱ https://github.com/styled-components/styled-components
https://github.com/MicheleBertoli/css-in-js
https://github.com/MicheleBertoli/css-in-js
styled-components
styled-components
ελΠϦϯάʹٻΊΔͷ - component ͝ͱʹείʔϓΛΓ͍ͨ - ͦͷελΠϧ͕Ͳ͜ͰΘΕ͍ͯΔ͔Γ͍ͨ - CSS ͱ JS
ͰΛڞ༗͍ͨ͠ - ΤσΟλͷγϯλοΫεϋΠϥΠτิػೳ͕͍͍ͨ - ඪ४ͷCSSͱಉ͡γϯλοΫεͰॻ͖͍ͨ - stylelint ͍͍ͨ - ಛఆͷπʔϧΛΘͳͯ͘ JS ͷΤϥʔ͕ు͔Εͳ͍
component ͝ͱʹείʔϓΛΓ͍ͨ
component ͝ͱʹείʔϓΛΓ͍ͨ
ͦͷελΠϧ͕Ͳ͜ͰΘΕ͍ͯΔ͔Θ͔Γ͍ͨ
ͦͷελΠϧ͕Ͳ͜ͰΘΕ͍ͯΔ͔Θ͔Γ͍ͨ ʢ = ؾܰʹελΠϧΛফ͍ͨ͠ʣ
ͦͷελΠϧ͕Ͳ͜ͰΘΕ͍ͯΔ͔Θ͔Γ͍ͨ
CSS ͱ JS ͰΛڞ༗͍ͨ͠
CSS ͱ JS ͰΛڞ༗͍ͨ͠
ΤσΟλͷγϯλοΫεϋΠϥΠτิػೳ͕͍͍ͨ
γϯλοΫεϋΠϥΠτิػೳ
ඪ४ͷCSSͱಉ͡γϯλοΫεͰॻ͖͍ͨ
ඪ४ͷCSSͱγϯλοΫε͕ဃͯ͠΄͘͠ͳ͍
stylelint ŧƂŧ
stylelint ŧƂŧ
ಛఆͷπʔϧΛΘͳͯ͘ JS ͷΤϥʔ͕Ͱͳ͍
ಛఆͷπʔϧΛΘͳͯ͘ JS ͷΤϥʔ͕Ͱͳ͍ - CSS Modules ͷωοΫ - Webpack ͳͲͰઃఆΛॻ͔ͳ͍ͱ
JS ͷΤϥʔ͕ు͔Ε ͯ͠·͏͕ɺwebpack ʹґଘͨ͘͠ͳ͍ɻ
ͳͥ styled-components ͔
ͳͥ styled-components ͔ - template literal Λ༻͍͍ͯΔͳ͔ͰҰ൪ star ͕ଟ͘ɺ ։ൃ׆ൃʹߦΘΕ͍ͯΔ
- React ͔Β͍͍͢Α͏ʹ࡞ΒΕ͍ͯΔ - ಠཱͨ͠ελΠϧ༻ͷίϯϙʔωϯτΛ࡞͍ͬͯ͘ͱ͍͏ํ๏ - React ͷίϯϙʔωϯτઃܭʹ߹ΘͤͯελΠϧܧঝͰ͖Δ - ReactNative ʹରԠ͍ͯ͠Δ
Ͱɻɻɻ
Ͱɻɻɻ ͬͱॏཁͳͷ ʮ͖Ε͍ͳίϯϙʔωϯτઃܭʯ͕Ͱ͖Δ͔ɻ → Ͳ͏͢Ε៉ྷͳίϯϙʔωϯτׂ͕Ͱ͖Δͷ͔ɺ ʑΜͰ͓Γ·͢
https://www.mercari.com/jp/jobs/