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 Modular — Boas Práticas e Bizus
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Daniel Fosco
July 06, 2015
Programming
110
1
Share
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
110
Utility CSS 2019
dfosco
0
87
UX Design – What, Why, How
dfosco
0
190
Portfolio Talk
dfosco
0
110
Utility CSS
dfosco
2
76
UX Design – Primeiros Passos
dfosco
1
120
Other Decks in Programming
See All in Programming
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
220
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
320
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
130
飯MCP
yusukebe
0
490
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
2.9k
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
320
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
150
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
110
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
9
5.3k
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
140
実践CRDT
tamadeveloper
0
420
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
460
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
510
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
97
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
110
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
150
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
New Earth Scene 8
popppiees
3
2k
Balancing Empowerment & Direction
lara
5
1k
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