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 design independent of Sass
Search
takanorip
October 03, 2019
Technology
2
1.1k
CSS design independent of Sass
takanorip
October 03, 2019
Tweet
Share
More Decks by takanorip
See All by takanorip
Design System Documentation Tooling 2025
takanorip
3
2k
デザインエンジニアの延長にデザインマネージャーとしての可能性を探る
takanorip
0
860
Tools for Design Engineers other than LLM in the LLM era
takanorip
1
610
Bulletproof Design System with TypeScript
takanorip
7
4.6k
Eleventy3.0 で始める爆速個人ブログ開発!
takanorip
0
230
Webフォント選定の極意!フォントの基本から最新トレンドまで徹底解説
takanorip
5
1k
効果的な管理画面を デザインをするために 避けるべき5つの罠
takanorip
15
7.6k
社内管理画面のデザインもプロダクトデザイン
takanorip
5
2.1k
早わかり W3C Community Group
takanorip
0
540
Other Decks in Technology
See All in Technology
歴史から学ぶ、Goのメモリ管理基礎
logica0419
10
2.3k
「駆動」って言葉、なんかカッコイイ_Mitz
comucal
PRO
0
140
サラリーマンソフトウェアエンジニアのキャリア
yuheinakasaka
24
8.5k
コールドスタンバイ構成でCDは可能か
hiramax
0
130
Master Dataグループ紹介資料
sansan33
PRO
1
4.2k
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.9k
自己管理型チームと個人のセルフマネジメント 〜モチベーション編〜
kakehashi
PRO
5
2.2k
ECS_EKS以外の選択肢_ROSA入門_.pdf
masakiokuda
1
120
Introduction to Bill One Development Engineer
sansan33
PRO
0
340
202512_AIoT.pdf
iotcomjpadmin
0
180
松尾研LLM講座2025 応用編Day3「軽量化」 講義資料
aratako
15
4.9k
「違う現場で格闘する二人」——社内コミュニティがつないだトヨタ流アジャイルの実践とその先
shinichitakeuchi
0
150
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
130
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
160
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
330
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
115
100k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
42
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
110
Context Engineering - Making Every Token Count
addyosmani
9
590
My Coaching Mixtape
mlcsv
0
21
Believing is Seeing
oripsolob
0
19
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.8k
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の闇 • 検索しにくいので開発効率が落ちる • 詳細度との戦いがつらい • 可読性が落ちる、見にくい
ネストを深くするのは 最終手段
おわり!