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
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
Node vs Deno vs Bun 〜推しランタイムを見つけよう〜
kamekyame
1
160
20251225_たのしい出張報告&IgniteRecap!
ponponmikankan
0
110
松尾研LLM講座2025 応用編Day3「軽量化」 講義資料
aratako
15
4.9k
田舎で20年スクラム(後編):一個人が企業で長期戦アジャイルに挑む意味
chinmo
1
940
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
330
なぜ あなたはそんなに re:Invent に行くのか?
miu_crescent
PRO
0
250
AIエージェントを5分で一気におさらい!AIエージェント「構築」元年に備えよう
yakumo
1
140
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
形式手法特論:コンパイラの「正しさ」は証明できるか? #burikaigi / BuriKaigi 2026
ytaka23
14
3.5k
ルネサンス開発者を育てる 1on1支援AIエージェント
yusukeshimizu
0
130
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
3
260
202512_AIoT.pdf
iotcomjpadmin
0
180
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
BBQ
matthewcrist
89
9.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Applied NLP in the Age of Generative AI
inesmontani
PRO
3
2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
What the history of the web can teach us about the future of AI
inesmontani
PRO
0
390
Documentation Writing (for coders)
carmenintech
77
5.2k
Speed Design
sergeychernyshev
33
1.5k
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