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
110
1
Share
CSS Modules
Think local, start compose!
Daniele Bertella
July 27, 2016
Other Decks in Technology
See All in Technology
Snowflake Intelligence導入で 分かった活用のコツ
wonohe
0
120
[最強DB講義]推薦システム | 基礎編
recsyslab
PRO
1
150
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.3k
AWS DevOps Agentはチームメイトになれるのか?/ Can AWS DevOps Agent become a teammate
kinunori
6
670
QGISプラグイン CMChangeDetector
naokimuroki
1
340
みんなで作るAWS Tips 100連発 (FinOps編)
schwrzktz
1
280
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
390
20260415_生成AIを専属DSに_自動レポート作成_ハンズオン_交通事故データ
doradora09
PRO
0
110
レビューしきれない?それは「全て人力でのレビュー」だからではないでしょうか
amixedcolor
0
290
Choose your own adventure in agentic design patterns
glaforge
0
120
20260423_執筆の工夫と裏側 技術書の企画から刊行まで / From the planning to the publication of technical book
nash_efp
1
360
AWS Agent Registry の基礎・概要を理解する/aws-agent-registry-intro
ren8k
2
350
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
27
3.4k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
250
What's in a price? How to price your products and services
michaelherold
247
13k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
Producing Creativity
orderedlist
PRO
348
40k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
We Have a Design System, Now What?
morganepeng
55
8.1k
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
160
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
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