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
CSS Modules
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Daniele Bertella
July 27, 2016
Technology
1
110
CSS Modules
Think local, start compose!
Daniele Bertella
July 27, 2016
Tweet
Share
Other Decks in Technology
See All in Technology
OWASP Top 10:2025 リリースと 少しの日本語化にまつわる裏話
okdt
PRO
3
510
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
130
AWS Network Firewall Proxyを触ってみた
nagisa53
0
180
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
340
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
490
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
290
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
620
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
570
2人で作ったAIダッシュボードが、開発組織の次の一手を照らした話― Cursor × SpecKit × 可視化の実践 ― Qiita AI Summit
noalisaai
1
370
Bill One急成長の舞台裏 開発組織が直面した失敗と教訓
sansantech
PRO
2
320
入社1ヶ月でデータパイプライン講座を作った話
waiwai2111
1
260
Context Engineeringの取り組み
nutslove
0
310
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
The Curious Case for Waylosing
cassininazir
0
230
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
49
New Earth Scene 8
popppiees
1
1.5k
How to build a perfect <img>
jonoalderson
1
4.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Prompt Engineering for Job Search
mfonobong
0
160
How to train your dragon (web standard)
notwaldorf
97
6.5k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
WCS-LA-2024
lcolladotor
0
450
Transcript
Think local and compose! 26 july 2016 @milanofrontend
JS Frontend Developer at LinkMe Srl Twitter: @_denb In love
with React and Javascript in general. I’m a 7-month-old dad Daniele Bertella
CSS
React: CSS in JS by vjeux
OOCSS, ACSS, BEM, SMACSS
<Button class="btn"> <Button class="btn btn--state-success"> <Button class="btn btn--state-danger">
None
CSS in JS
<Button type="button" className="btn btn--primary"> <PrimaryBtn />
<Button type="button" class="SomeLibBtn flamey-text rainbowborder" style={{fontSize: "4rem"}} >
If you’re writing React, you have access to a more
powerful styling construct than CSS class names. You have components.
React: CSS in JS by vjeux
CSS in JS https://github.com/MicheleBertoli/css-in-js React: CSS in JS techniques comparison
None
CSS Modules
Not inline styles, just classes, CSS classes
.title { font-size: 36px; }
No more Global Scope
<h1 class="title__App__3Q9Zt" >Titolo</h1>
No more Overqualified Selectors
.home h1.big { font-size: 36px; }
Refactoring made it easy
<Title>Titolo</Title>
How does it work?
Composes
.title { font-size: 14px } .h1 { composes: title; composes:
bold from ‘./base. css’; }
<h1 class="h1__App__45dEA title__App__3Q9Zt bold__Common__qA8s1" >Titolo</h1>
:global
:global .title { font-size: 14px }
<h1 class="h1__App__45dEA title bold__Common__qA8s1" >Titolo</h1>
@value
@value primary-color: #b04208 .title { color: primary-color; }
@value primary-color from 'css/base.css'; .title { color: primary-color; }
Atomic CSS Modules
.image { composes: left p2 mr1 border from 'basscss/css/basscss.css'; }
<div class="image__App-styles__2Smk3 left__basscss__3v_U_ p2__basscss__F9Oep mr1__basscss__3xYN_ border__basscss__2qjJA" ><img src=... /></div>
Atomic CSS Modules https://medium.com/yplan-eng/atomic-css-modules-cb44d5993b27
Are CSS Modules right for my (next) project?
Maybe
Happy with BEM?
NO
Component architecture?
YES
QUESTIONS?
Thanks @_denb