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
87
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
250627 関西Ruby会議08 前夜祭 RejectKaigi「DJ on Ruby Ver.0.1」
msykd
PRO
2
370
怖くない!はじめてのClaude Code
shinya337
0
310
Model Mondays S2E03: SLMs & Reasoning
nitya
0
240
Oracle Cloud Infrastructure:2025年6月度サービス・アップデート
oracle4engineer
PRO
2
310
Delegating the chores of authenticating users to Keycloak
ahus1
0
130
開発生産性を組織全体の「生産性」へ! 部門間連携の壁を越える実践的ステップ
sudo5in5k
0
570
タイミーのデータモデリング事例と今後のチャレンジ
ttccddtoki
4
1.7k
5min GuardDuty Extended Threat Detection EKS
takakuni
0
180
WordPressから ヘッドレスCMSへ! Storyblokへの移行プロセス
nyata
0
350
Lambda Web Adapterについて自分なりに理解してみた
smt7174
5
140
ハッカソン by 生成AIハッカソンvol.05
1ftseabass
PRO
0
150
使いたいMCPサーバーはWeb APIをラップして自分で作る #QiitaBash
bengo4com
0
1.4k
Featured
See All Featured
Bash Introduction
62gerente
614
210k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
24k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Building Adaptive Systems
keathley
43
2.6k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
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!