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
Generative UI を試そう!A2-UIでAIエージェントにダッシュボードを作らせてみた
kamoshika
0
200
なぜ令和の今ゲームボーイを触るのか
kimkim0106
0
110
量子クラウドシステムと運用
oqtopus
0
170
30分でわかる「ネットワーク図の描き方入門」/infraengbooks56
corestate55
1
320
コンテナセキュリティの最新事情 ~ 2026年版 ~
kyohmizu
8
3k
22nd ACRi Webinar - NTT Kawahara-san's slide
nao_sumikawa
0
130
20260208_第66回 コンピュータビジョン勉強会
keiichiito1978
0
240
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
220
私たち準委任PdEは2つのプロダクトに挑戦する ~ソフトウェア、開発支援という”二重”のプロダクトエンジニアリングの実践~ / 20260212 Naoki Takahashi
shift_evolve
PRO
3
340
Agent Skills 入門
puku0x
0
270
【Oracle Cloud ウェビナー】[Oracle AI Database + AWS] Oracle Database@AWSで広がるクラウドの新たな選択肢とAI時代のデータ戦略
oracle4engineer
PRO
2
230
登壇駆動学習のすすめ — CfPのネタの見つけ方と書くときに意識していること
bicstone
3
220
Featured
See All Featured
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
350
The agentic SEO stack - context over prompts
schlessera
0
660
The browser strikes back
jonoalderson
0
710
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
440
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
370
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
89
Optimizing for Happiness
mojombo
379
71k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
230
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
82
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Utilizing Notion as your number one productivity tool
mfonobong
3
220
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
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