Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
CSS Modular — Boas Práticas e Bizus
Search
Daniel Fosco
July 06, 2015
Programming
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CSS Modular — Boas Práticas e Bizus
Lightning Talk dado no VTEX Lab em 06/07/2015
Daniel Fosco
July 06, 2015
More Decks by Daniel Fosco
See All by Daniel Fosco
Let's talk about design portfolios
dfosco
3
120
Utility CSS 2019
dfosco
0
94
UX Design – What, Why, How
dfosco
0
210
Portfolio Talk
dfosco
0
130
Utility CSS
dfosco
2
82
UX Design – Primeiros Passos
dfosco
1
140
Other Decks in Programming
See All in Programming
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.1k
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.6k
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
580
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
250
mrbgem 三角測量 開発
ogom
0
230
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
350
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
160
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
470
最近”作らせてる” ローカルAIアプリの話
akit37
0
440
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5k
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
130
Java 27新機能 / Java 27 new features
kishida
2
210
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
2
1.9k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Utilizing Notion as your number one productivity tool
mfonobong
4
610
Designing Experiences People Love
moore
143
24k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
We Are The Robots
honzajavorek
0
390
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
Chasing Engaging Ingredients in Design
codingconduct
0
350
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
570
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
930
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Transcript
CSS MODULAR BOAS PRÁTICAS E BIZUS NOTDANIELFOSCO 1
CSS MODULAR 2
UMA COISA É UMA COISA E OUTRA COISA É OUTRA
COISA 3
4
BACANA 5
BOSTA 6
REACT 7
UI MATTER 8
COMPONENTES DE UI PADRÃO DA VTEX 9
COMPONENTES DE UI PADRÃO DA VTEX Pode Melhorar 10
Como? 11
MARKUP SEMÂNTICO ! 12
“NO ITEMS YET” UM ÚNICO COMPONENTE... 13
...MAIS DE UMA CLASSE NO MARKUP <div class="uim-no-items well text-muted
text-center"> ... </div> .uim-no-items { ... } 14
UMA COISA É UMA COISA E OUTRA COISA É OUTRA
COISA 15
SOLUÇÃO (COM LESS) <div class="uim-no-items"> ... </div> .uim-no-items { .well;
.text-muted; .text-center; ... } 16
SOLUÇÃO (COM SCSS) <div class="uim-no-items"> ... </div> .uim-no-items { @extend
.well; @extend .text-muted; @extend .text-center; ... } 17
SOLUÇÃO (COM SCSS AINDA MELHOR) <div class="uim-no-items"> ... </div> .uim-no-items
{ %extend .well; %extend .text-muted; %extend .text-center; ... } 18
(NUM MUNDO IDEAL, NEM USARÍAMOS MAIS BOOTSTRAP, APENAS ESTILOS CRIADOS
INTERNAMENTE) 19
NESTING 20
MIGA, APENAS PARE ! 21
PERFORMANCE DO CAPETA ! 22
.card { background: blue; .card-title { font-size: 1.2em; } .card-image
{ img { width: 100px; } } p { font-size: 1em; } } 23
.card { background: blue; } .card .card-title { font-size: 1.2em;
} .card .card-image img { width: 100px; } .card p { font-size: 1em; } 24
CSS VINCULADO AO HTML... 25
<div class="card"> <h1 class="card-title">Very nice card</h1> <div class="card-image"> <img src="#"
alt=""> </div> <p>Wow, much nice</p> </div> 26
<h1 class="card-title">Very nice card</h1> <div class="card"> <div class="card-image"> <img src="#"
alt=""> </div> <p>Wow, much nice</p> </div> 27
QUEBRA NO CSS QUANDO MUDA A ESTRUTURA DO MARKUP !
28
POR ÚLTIMO... 29
INCEPTION MALDITO ! 30
QUANDO USAR NESTING ! 31
PSEUDO-CLASSES ! 32
.card { background: blue; &:focus {...}; &:hover {...}; &:last-child {...}
} 33
BOM SENSO ! 34
.card { background: blue; & + & {...}; img {
... } } 35
COMO ORGANIZAR SUAS CLASSES? 36
BEM 37
BLOCK ELEMENT MODIFIER 38
BLOCK ELEMENT MODIFIER 39
BLOCK ELEMENT MODIFIER 40
.block {...} .block__element {...} .block--modifier {...} 41
.card { background: blue; } 42
.card { background: blue; } .card__title { font-size: 1.2em; }
43
.card { background: blue; } .card__title { font-size: 1.2em; }
.card--big { .card; width: 100%; } 44
.card { background: blue; } .card__title { font-size: 1.2em; }
.card__text { font-size: 1em; } .card--is-active { .card; opacity: 1; } 45
FUTURO 46
REACT CSS MODULES 47
.card { background: blue; } .card { background: red; }
48
https://github.com/css-modules 49
OBRIGADO NOTDANIELFOSCO 50