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 Linter による Baseline サポートの仕組み
Search
mattsuu
February 21, 2025
Programming
430
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CSS Linter による Baseline サポートの仕組み
Browser and UI #1 CSS (2025/02/21) での発表資料
https://browser-and-ui.connpass.com/event/341857/
mattsuu
February 21, 2025
More Decks by mattsuu
See All by mattsuu
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
400
CSS Linter の現在地 2025年のベストプラクティスを探る
ryo_manba
12
4.6k
React Aria で実現する次世代のアクセシビリティ
ryo_manba
5
3.3k
5分で分かる React Aria の 良いところ・これからなところ
ryo_manba
5
7.1k
アクセシブルなインクリメンタルサーチを作ってみた
ryo_manba
2
640
Next.js の fetch 拡張とキャッシュ機構の違いを理解する
ryo_manba
6
1.9k
React Spectrum Libraries によるアクセシブルなUIの構築
ryo_manba
0
4.7k
Other Decks in Programming
See All in Programming
[PyCon KR 2026] More Variants, More Diversity for AI Accelerators
achimnol
0
130
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
0
400
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
53
35k
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
140
Hono + Inertia + React で LP を構築した話
oukayuka
2
200
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
550
Press start. Python's next generation.
willingc
PRO
3
300
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
0
210
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
970
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
330
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
1.7k
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
How to make the Groovebox
asonas
2
2.4k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
720
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
870
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
450
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
640
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.9k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
410
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
550
Transcript
CSS Linter による Baseline サポートの仕組み まっつー / @ryo_manba 2025/02/21 Browser
and UI #1 CSS
自己紹介 まっつー • メルカリ • フロントエンドエンジニア • HeroUI, Stylelint チームメンバー
• 𝕏: @ryo_manba • GitHub: @ryo-manba
Baseline • 主要ブラウザでの Web 標準のサポート状況 ◦ Chrome, Edge, Safari, Firefox
• 3つのステータス ◦ Widely available: 主要ブラウザでサポートされて2.5年 ◦ Newly available: 主要ブラウザでサポート ◦ Limited availability: 上記の基準を満たさない 3
Baseline を確認する 4
正しい定義を見落とす可能性 • clip-path (基本機能) → Widely • fill-box, stroke-box, view-box
→ Newly • Animatable clipping paths → Limited 5 mdn「Widely です」 開発者「よし、通れ!」
Linter でチェックしたい…
@eslint/css によるサポート • require-baseline ルールが追加 • Baseline の Widely か
Newly をオプションで指定し、 満たさない場合に警告を出す 7
require-baseline ルールの仕組み 1. Baseline のデータを取得する 2. @supports をチェックする 3. Baseline
のステータスを比較する 8
Baseline のデータを取得する • @web-features から取得 ◦ WebDX Community Group が提供するライブラリ
◦ YAML をパースして JavaScript オブジェクトにしているだけ → 操作性が低い、不要な情報も含まれている • @eslint/css で名前とレベルのみの形式に変換して管理 9
@supports のチェック @supports を利用している場合、警告を出す必要がない 10
@supports のネストへの対応 ネストを考慮して適用範囲を管理している 11
機能の Baseline ステータスを取得する 12
機能の Baseline ステータスを比較する 13
まとめ • @eslint/css の require-baseline ルールでは、 ◦ web-features から Baseline
の定義を取得 ◦ @supports の適用範囲をコンテキストとして管理 ◦ これらを元に Baseline ステータスを比較 • Baseline が活用しやすくなった! 14
余談: Stylelint のプラグインでも実現できる? • stylelint-no-unsupported-browser-features と browserslist を組み合わせれば近いことはできる • しかし、検知できない機能が複数ある
◦ 内部で利用している @doiuse の対応を待つしかない • @supports の対応もない Stylelint 本体がサポートするまでは難しそう… 15