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
Search
James Shedden
June 24, 2015
Technology
1
89
CSS
How I make cool & maintainable stuff, fast.
James Shedden
June 24, 2015
Tweet
Share
More Decks by James Shedden
See All by James Shedden
Flexbox is cool and fun
jamesshedden
1
140
Other Decks in Technology
See All in Technology
要件定義・デザインフェーズでもAIを活用して、コミュニケーションの密度を高める
kazukihayase
0
110
react-callを使ってダイヤログをいろんなとこで再利用しよう!
shinaps
1
240
KotlinConf 2025_イベントレポート
sony
1
140
AWSで始める実践Dagster入門
kitagawaz
1
620
未経験者・初心者に贈る!40分でわかるAndroidアプリ開発の今と大事なポイント
operando
5
630
DDD集約とサービスコンテキスト境界との関係性
pandayumi
3
280
[ JAWS-UG 東京 CommunityBuilders Night #2 ]SlackとAmazon Q Developerで 運用効率化を模索する
sh_fk2
3
430
テストを軸にした生き残り術
kworkdev
PRO
0
210
企業の生成AIガバナンスにおけるエージェントとセキュリティ
lycorptech_jp
PRO
2
170
Language Update: Java
skrb
2
300
Function Body Macros で、SwiftUI の View に Accessibility Identifier を自動付与する/Function Body Macros: Autogenerate accessibility identifiers for SwiftUI Views
miichan
2
180
【NoMapsTECH 2025】AI Edge Computing Workshop
akit37
0
180
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
840
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
112
20k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
How STYLIGHT went responsive
nonsquared
100
5.8k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Speed Design
sergeychernyshev
32
1.1k
The World Runs on Bad Software
bkeepers
PRO
70
11k
The Invisible Side of Design
smashingmag
301
51k
GraphQLの誤解/rethinking-graphql
sonatard
72
11k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Art of Programming - Codeland 2020
erikaheidi
56
13k
Transcript
CSS!
I want to...
I want to make cool stuff.
I want to make cool stuff, fast.
I want to make cool & maintainable stuff, fast.
Let’s make an app.
Let’s make our app look awesome.
Let’s make it easy to make our app look awesome.
/css /components /base /utilities main.css
The individual building blocks /components The fundamental rules /base Classes
for adjusting CSS within templates /utilities All the above imported main.css
Variables
SASS Variables $color-primary CSS Variables var(—-color-primary)
Pre-processing
SASS & LESS Pre-processors REWORK & POSTCSS Pre-processing plugin frameworks
Building, watching & reloading.
Let’s start making our app look cool.
Naming
BEM Block, Element, Modifier
Block block Element block__element Modifier block__element—-modifier
Cue human body analogy
Block block Element block__element Modifier block__element—-modifier
Block person Element person__arm Modifier person__arm—-left
Maybe not .person__arm__hand__finger Maybe .person .arm .hand__finger—-ring
HTML
HTML + CSS
HTML + CSS + JS
<div></div>
<div class=“person”> <div class=“person__arm person__arm—-left”> Left arm </div> <div class=“person__arm
person__arm—-right”> Right arm </div> </div>
<div class=“person”> <div class=“person__arm person__arm—-left”> Left arm </div> <div class=“person__arm
person__arm—-right”> Right arm </div> </div> /css/components/person.css .person {} .person__arm {} .person__arm—-left {}
<div class=“person”> <div class=“person__arm person__arm—-left”> Left arm </div> <div class=“person__arm
person__arm—-right u-margin-Tm”> Right arm </div> </div> /css/utilities/space.css .u-margin-Tm { margin-top: var(—-space-medium); }
Utilities
<div class=“u-display-block u-margin-Vm u-color-primary u-background-meta u- padding-Lm u-padding-Rs u-text-heading u-
text-m u-text-no-smoothing”> Forever alone </div>
<div class=“u-display-block u-margin-Vm u-color- primary u-background-meta u-padding-Lm u-padding- Rs u-text-heading
u-text-m u-text-no-smoothing”> Much CSS </div> <div class=“u-display-block u-margin-Vm u-color- primary u-background-meta u-padding-Lm u-padding- Rs u-text-heading u-text-m u-text-no-smoothing”> Very stylesheets </div> <div class=“u-display-block u-margin-Vm u-color- primary u-background-meta u-padding-Lm u-padding- Rs u-text-heading u-text-m u-text-no-smoothing”> Such utility class </div>
<div class=“my-cool-component”> Much CSS </div> <div class=“my-cool-component u-text-no-smoothing”> Very stylesheets
</div> <div class=“my-cool-component u-background-meta”> Such utility class </div>
Our app Lets us work quickly Easy to maintain Looks
awesome
Cheers!