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
Styling in React
Search
Drew Powers
June 21, 2018
Technology
47
0
Share
Styling in React
Drew Powers
June 21, 2018
More Decks by Drew Powers
See All by Drew Powers
Styling Systems in React
dangodev
0
64
Browser Rendering & Performance
dangodev
0
53
Virtual & Augmented Reality
dangodev
0
120
Design of the Web (2017)
dangodev
0
92
The Science of Font Selection
dangodev
2
500
Other Decks in Technology
See All in Technology
地元にいないローカルオーガナイザーの立ち回り
uvb_76
1
450
oracle-to-databricks-migration-with-llm-and-dbt
casek
1
430
Claude Codeを組織で使いこなす— サーバサイドAIエージェント運用の実践知
techtekt
PRO
0
190
エンジニアは生成AIと どのように向き合うべきか? ことばの意味という観点から
verypluming
3
340
Ruby::Boxでできること、Refinementsでできること
joker1007
3
380
さきさん文庫の書籍ができるまで
sakiengineer
0
340
GoとSIMDとWasmの今。
askua
3
490
AIガバナンス実践 - 生成AIコネクタのデータ漏洩リスクと実務対策
knishioka
0
170
Unlocking the Apps
pimterry
0
190
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.9k
Diagnosing performance problems without the guesswork
elenatanasoiu
0
160
関西に縁あるMicrosoft MVPsが語るCopilotの未来
kasada
0
1k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
RailsConf 2023
tenderlove
30
1.5k
Balancing Empowerment & Direction
lara
6
1.1k
Into the Great Unknown - MozCon
thekraken
41
2.5k
Prompt Engineering for Job Search
mfonobong
0
330
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
22k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Practical Orchestrator
shlominoach
191
11k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
190
First, design no harm
axbom
PRO
2
1.2k
Transcript
5 TIPS FOR STYLING IN REACT 1 2 3 4
5
AVOID NESTED SELECTORS 1 2 3 4 5
None
BEGUN, THE SPECIFICITY WAR HAS
KEEP LAYOUT WITHIN COMPONENTS 1 2 3 4 5
None
None
None
AVOID MAGIC NUMBERS 1 2 3 4 5
None
None
MAKE BREAKPOINTS WHEN IT LOOKS WEIRD (DON’T MANAGE GLOBAL BREAKPOINTS)
1 2 3 4 5
635 PX t HOME SHOP GALLERY ABOUT CONTACT 600 PX
/ 900 PX / 1200 PX / 1800 PX THE 100% CORRECT WAY TO DO CSS BREAKPOINTS
DON’T EXTEND STYLES 1 2 3 4 5 (PLEASE REPEAT
YOURSELF)
SASS STYLED COMPONENTS
COINCIDENCE
None
LEARN SIBLING SELECTORS 1 2 3 4 5 6 7
8
REACT • ONCLICK • HANDLE TAB KEY • HANDLE SPACE
BAR • HANDLE ACCESSIBILITY CSS
+ > ~ * [ ]
USE BETTER EASINGS 1 2 3 4 5 6 7
8
linear transition-timing-function border-color box-shadow color opacity transform: rotate cubic-bezier() transform:
scale translate MATERIAL.IO / DESIGN / MOTION / SPEED.HTML#EASING animation-timing-function
USE A RESPONSIVE TYPE SCALE 1 2 3 4 5
6 7 8
8 10 12 14 16 20 24 28 36 48
None
None
“RESPONSIVE TYPE SCALE”
THANKS! 1 2 3 4 5 @_DREWPOWERS