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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Daniele Bertella
July 27, 2016
Technology
120
1
Share
CSS Modules
Think local, start compose!
Daniele Bertella
July 27, 2016
Other Decks in Technology
See All in Technology
鹿野さんに聞く!CSSの最新トレンド Ver.2026
tonkotsuboy_com
6
2.7k
20260516_SecJAWS_Days
takuyay0ne
0
130
試作とデモンストレーション / Prototyping and Demonstrations
ks91
PRO
0
200
Digital Independence: Why, When and How
wannesrams
0
310
いつの間にかデータエンジニア以外の業務も増えていたけど、意外と経験が役に立ってる
zozotech
PRO
0
350
(きっとたぶん)人材育成や教育のような何かの話
sejima
0
680
Forget technical debt
ufried
0
180
freeeで運用しているAIQAについて
qatonchan
0
470
ServiceによるKubernetes通信制御ーClusterIPを例に
miku01
1
160
会社説明資料|株式会社ギークプラス ソフトウェア事業部
geekplus_tech
0
210
AI対話分析の夢と、汚いデータの現実 Looker / Dataplex / Dataform で実現する品質ファーストな基盤設計
waiwai2111
0
280
[Oracle TechNight#99] 生成AI時代のAI/ML入門 ~ AIとオラクルデータベースの関係 (後半)
oracle4engineer
PRO
3
250
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
190
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
340
How to make the Groovebox
asonas
2
2.2k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
350
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
370
AI: The stuff that nobody shows you
jnunemaker
PRO
6
630
New Earth Scene 8
popppiees
3
2.2k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
170
Site-Speed That Sticks
csswizardry
13
1.2k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
150
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
170
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