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
AI-Slopなデザインを生まないためのデザインプロセス戦略
takanorip
10
5.9k
「見せる」登壇資料デザインの極意
takanorip
7
1.6k
Design System Documentation Tooling 2025
takanorip
3
3k
デザインエンジニアの延長にデザインマネージャーとしての可能性を探る
takanorip
1
1.3k
Tools for Design Engineers other than LLM in the LLM era
takanorip
1
880
Bulletproof Design System with TypeScript
takanorip
7
5.4k
Eleventy3.0 で始める爆速個人ブログ開発!
takanorip
0
320
Webフォント選定の極意!フォントの基本から最新トレンドまで徹底解説
takanorip
6
1.2k
効果的な管理画面を デザインをするために 避けるべき5つの罠
takanorip
15
8k
Other Decks in Technology
See All in Technology
AI に書かせたその API、 “信頼” できますか?
nagix
0
110
事業課題から技術的負債に向き合う
sansantech
PRO
2
1.8k
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
110
DEFCON_CHV_CTF_Write-up.pdf
bata_24
0
150
Deploying a Full-Stack Bun-Native Framework on Cloudflare Workers
7nohe
0
170
アクセスキーこわい やめかたと漏らさない工夫
sassssan68
1
230
SQL文一行も書けない人事がCortexもろもろを使って人事業務を楽にしてみる
ponponmikankan
1
240
Slack上でインフラをトラブルシュートする! Agentic Platform Engineeringの第一歩
teru0x1
4
1.7k
iOSDC Japan 2026 day1 TrackC 10:50
feedtailor
1
160
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
2
2.1k
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
4
600
20260912_スクフェス三河
kgnkhkr
0
380
Featured
See All Featured
A better future with KSS
kneath
240
18k
Claude Code のすすめ
schroneko
67
230k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Thoughts on Productivity
jonyablonski
76
5.4k
The browser strikes back
jonoalderson
0
1.7k
Are puppies a ranking factor?
jonoalderson
2
3.9k
Being A Developer After 40
akosma
91
590k
The SEO identity crisis: Don't let AI make you average
varn
0
560
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Producing Creativity
orderedlist
PRO
348
41k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
480
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
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の闇 • 検索しにくいので開発効率が落ちる • 詳細度との戦いがつらい • 可読性が落ちる、見にくい
ネストを深くするのは 最終手段
おわり!