Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
CSS design independent of Sass
Search
takanorip
October 03, 2019
Technology
1.1k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CSS design independent of Sass
takanorip
October 03, 2019
More Decks by takanorip
See All by takanorip
今さら理解するウェブフォントver.2026
takanorip
3
900
AI-Slopなデザインを生まないためのデザインプロセス戦略
takanorip
10
6.3k
「見せる」登壇資料デザインの極意
takanorip
7
1.8k
Design System Documentation Tooling 2025
takanorip
3
3.1k
デザインエンジニアの延長にデザインマネージャーとしての可能性を探る
takanorip
1
1.4k
Tools for Design Engineers other than LLM in the LLM era
takanorip
1
920
Bulletproof Design System with TypeScript
takanorip
7
5.4k
Eleventy3.0 で始める爆速個人ブログ開発!
takanorip
0
320
Webフォント選定の極意!フォントの基本から最新トレンドまで徹底解説
takanorip
6
1.2k
Other Decks in Technology
See All in Technology
NDIでApple Vision Proにリアルタイム映像送信
jyouryuusui
0
130
Kiro Crewをはじめよう
kizawa2020
1
160
会社説明資料
persolserverworks
0
9.8k
FinOps Agentが生んだ技術負債:コスト自動調査の落とし穴と解消までの道のり
oasis1994liveforever
2
140
CTO Night|NotionのAIエージェントとFDE
kzkhykw1991
0
230
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
180
TinyGoでオブザーバビリティ?OpenTelemetryはTinyGoで使えるのか / Is OpenTelemetry available in TinyGo environment?
ymotongpoo
2
140
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
890
JAWSUG TOHOKU 青森支部 「LoGoチャット」のAWS移行で 乗り越えたこと
taketakekaho
0
340
その Valkey 使いこなしていますか?
onk
PRO
5
1.6k
Optunaの最新リリースv5.0について
pfn
PRO
0
120
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
190
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
10k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
360
Chasing Engaging Ingredients in Design
codingconduct
0
360
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
How to train your dragon (web standard)
notwaldorf
96
6.9k
The Cult of Friendly URLs
andyhume
79
7k
Speed Design
sergeychernyshev
33
2.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
The SEO identity crisis: Don't let AI make you average
varn
0
590
Faster Mobile Websites
deanohume
310
32k
Transcript
Sassに頼らない CSS設計 Takanori Oki @Meguro.css 2019/10/03
自己紹介 • 大木尊紀 / takanorip • フロントエンドエンジニア • Figma、ウェブフォント、Web Components
• 最近のマイブーム: 良い写真撮れたらsuzuriでシャツ作ること
Sass使ってますか?
Sass is useful!
But,
Too FAT!!!
Sassは機能が多すぎる • 便利だけど使いこなすのが難しいし、 機能が多すぎて把握できない。 • 注意が必要な機能もある。 (@mixin、@extend、ネスト、など) • Sassの機能を使うことが目的になってない?
Sassに頼らずシンプルに CSS設計をするのが良さそう (あくまで個人の見解です)
1. 上書きをなくす
悪い例
CSSの上書きが発生してる!
良い例
None
こういう悪い例は 過度な共通化をしている 場合に発生しがち
CSSのDRYは諦める
Custom properties
Custom properties • 別名CSS変数
Custom properties • :root = <html> • 親要素で定義されたCustom propertiesは子 要素でも参照できる
• var()で変数を参照する • var(variable, default)
Theming • 色やフォントの大きさなど、パーツの装飾要 素をCustom propertiesで定義し、それを利 用することでstyleを統一する。 • 過度な共通化を防げる • 全体のテーマなどを一気に変更したいときに
便利(ダークテーマ対応とか)
2. ScopedなCSSを書く
ScopedなCSSを書く方法 • BEM、FLOCSSなどの命名規則を取り入れる • CSS Modules、CSS in JS (styled-components、emotionなど) •
Shadow DOMを使う
ScopedなCSSを書くために Sassは必要ない
3. フラットなCSSを書く
ネストの深いCSSの闇 • 検索しにくいので開発効率が落ちる • 詳細度との戦いがつらい • 可読性が落ちる、見にくい
ネストを深くするのは 最終手段
おわり!