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
0
25
Styling in React
Drew Powers
June 21, 2018
Tweet
Share
More Decks by Drew Powers
See All by Drew Powers
Styling Systems in React
dangodev
0
46
Browser Rendering & Performance
dangodev
0
36
Virtual & Augmented Reality
dangodev
0
90
Design of the Web (2017)
dangodev
0
65
The Science of Font Selection
dangodev
2
390
Other Decks in Technology
See All in Technology
【日本Zabbixユーザー会】LLDを理解するときの勘所 〜LLDのある世界を楽しもう!〜
yoshitake945
0
130
AIで進化するソフトウェアテスト:mablの最新生成AI機能でQAを加速!
mfunaki
0
130
AIエージェントの地上戦 〜開発計画と運用実践 / 2025/04/08 Findy W&Bミートアップ #19
smiyawaki0820
29
9k
AWS Control Towerを 数年運用してきての気づきとこれから/aws-controltower-ops-tips
tadayukinakamura
0
110
20250408 AI Agent workshop
sakana_ai
PRO
15
3.7k
Lakeflow Connectのご紹介
databricksjapan
0
100
ソフトウェア開発現代史: "LeanとDevOpsの科学"の「科学」とは何か? - DORA Report 10年の変遷を追って - #DevOpsDaysTokyo
takabow
0
360
低レイヤを知りたいPHPerのためのCコンパイラ作成入門 / Building a C Compiler for PHPers Who Want to Dive into Low-Level Programming
tomzoh
0
220
AI Agentを「期待通り」に動かすために:設計アプローチの模索と現在地
kworkdev
PRO
2
410
Amazon S3 Tables + Amazon Athena / Apache Iceberg
okaru
0
260
Micro Frontends: Necessity, Implementation, and Challenges
rainerhahnekamp
2
430
【2025年度新卒技術研修】100分で学ぶ サイバーエージェントのデータベース 活用事例とMySQLパフォーマンス調査
cyberagentdevelopers
PRO
5
7k
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
223
9.6k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
We Have a Design System, Now What?
morganepeng
52
7.5k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
How to train your dragon (web standard)
notwaldorf
90
6k
The Pragmatic Product Professional
lauravandoore
33
6.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
29
5.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
41
2.2k
The Invisible Side of Design
smashingmag
299
50k
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