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
Navigation APIと見るSvelteKitのWeb標準志向
yamanoku
2
130
FASTでAIエージェントを作りまくろう!
yukiogawa
4
150
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
3
2k
VSCode中心だった自分がターミナル沼に入門した話
sanogemaru
0
820
AI時代のオンプレ-クラウドキャリアチェンジ考
yuu0w0yuu
0
570
FastMCP OAuth Proxy with Cognito
hironobuiga
3
220
20260326_AIDD事例紹介_ULSC.pdf
findy_eventslides
0
130
OPENLOGI Company Profile for engineer
hr01
1
61k
BFCacheを活用して無限スクロールのUX を改善した話
apple_yagi
0
130
AI時代のシステム開発者の仕事_20260328
sengtor
0
300
「AIエージェントで変わる開発プロセス―レビューボトルネックからの脱却」
lycorptech_jp
PRO
0
170
「お金で解決」が全てではない!大規模WebアプリのCI高速化 #phperkaigi
stefafafan
5
2.4k
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
490
SEO for Brand Visibility & Recognition
aleyda
0
4.4k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
240
Navigating Team Friction
lara
192
16k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
100
Tell your own story through comics
letsgokoyo
1
870
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.1k
Practical Orchestrator
shlominoach
191
11k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
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