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の最新トレンド Ver.2026
Search
tonkotsuboy_com
May 13, 2026
Technology
170
3
Share
鹿野さんに聞く!CSSの最新トレンド Ver.2026
鹿野さんに聞く!CSSの最新トレンド Ver.2026 - connpass
https://findy.connpass.com/event/390152/
の登壇資料です
tonkotsuboy_com
May 13, 2026
More Decks by tonkotsuboy_com
See All by tonkotsuboy_com
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
8
2.8k
CSSの最新トレンド Ver.2025
tonkotsuboy_com
14
8.6k
鹿野さんに聞く! 2024年最新CSSトレンドと実践テクニック
tonkotsuboy_com
15
10k
CSS Subgridが遂に全ブラウザ対応。新時代のグリッドデザインを学ぼう
tonkotsuboy_com
9
9.7k
2023年モダンCSSの最新トレンド
tonkotsuboy_com
24
20k
全ブラウザ対応したcontainer queryは何がスゴイのか?
tonkotsuboy_com
13
17k
TypeScript 4.9のas const satisfiesが便利
tonkotsuboy_com
11
7.2k
CSS Grid・Flexboxの 最近の進化とミライ
tonkotsuboy_com
4
4.9k
これだけは押さえておきたい ES2022の便利機能
tonkotsuboy_com
9
5.7k
Other Decks in Technology
See All in Technology
知ってた?JavaScriptの"正しさ"を検証するテストが5万以上もあること(Test262)
riyaamemiya
1
150
「誰一人取り残されない」 AIエージェント時代のプロダクト設計思想 Product Management Summit 2026
mizushimac
1
2.9k
小さいVue.jsを30分で作る
hal_spidernight
0
140
Building a Study Buddy AI Agent from Scratch: From Passive Chatbots to Autonomous Systems
itchimonji
0
140
GitHub Copilot Dev Days
tomokusaba
0
150
エージェント時代の UIとAPI、CLI戦略
coincheck_recruit
0
140
Agents CLI と Gemini Enterprise Agent Platform で マルチエージェント開発が楽しくなる!
kaz1437
0
240
バイブコーディングで3倍早く⚪⚪を作ってみた
samakada
0
220
ServiceによるKubernetes通信制御ーClusterIPを例に
miku01
1
140
コミュニティ・勉強会を作るのは目的じゃない
ohmori_yusuke
0
290
Building Production-Ready Agents Microsoft Agent Framework
_mertmetin
0
160
国内外の生成AIセキュリティの最新動向 & AIガードレール製品「chakoshi」のご紹介 / Latest Trends in Generative AI Security (Domestic & International) & Introduction to AI Guardrail Product "chakoshi"
nttcom
4
1.7k
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
240
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Unsuck your backbone
ammeep
672
58k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Skip the Path - Find Your Career Trail
mkilby
1
110
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
110
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
530
The Invisible Side of Design
smashingmag
302
52k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
380
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Transcript
None
CSSと猫が大好きです @tonkotsuboy_com 鹿野 壮
1. グラデーションをきれいに見せる (oklch × background-clip: text ) 2. 要素を基準にポップオーバーを表示する (anchor-position
× popover ) 3. JavaScriptなしでdialog・popoverを開閉する (command / commandfor ) 4. 行列を入れ子にする(subgrid ) 本日の構成
新しいCSSを学ぶメリットとは? 新しいCSSが日々生まれている
長い JavaScript で実現していたものが、 短い CSS で済む 読みやすいコードになり、 開発者体験(DX)が向上する バグが減り、制作物の品質が向上する 新しいCSSを学ぶメリット
ブラウザ実装状況を知る指標 01 ベースライン
HTML・CSS・JavaScript等のブラウザサポートの情報 Newly available Chrome, Edge, Firefox, Safariのデスクトップ版・モバイル版 すべてで対応した機能 Widely available
Newly available になってから 30ヶ月経過した機能 Limited availability 未対応のブラウザがある機能 ベースラインとは https://web.dev/baseline
ベースラインをMDNで確認する https://developer.mozilla.org/ja/docs/Web/CSS/Guides/Grid_layout/Subgrid
ベースラインを Can I Use で確認する https://caniuse.com/css-subgrid
ベースラインをweb.devで確認する
2024 popover , @starting-style , text-wrap: balance , light-dark() ,
scrollbar-gutter , backdrop-filter 2025 @scope , ビュートランジション, ::details-content , contenteditable="plaintext-only" 2026 contrast-color() , ::highlight , text-indent: each-line , shape() , rcap 2024-2026のHTML・CSSのベースラインの一部 https://web.dev/baseline/2026?hl=ja
ベースラインで利用可能な CSSを中心に紹介します
01 イマドキCSS
01 グラデーションをきれいに見せる oklch と background-clip: text
Demo
デモ: テキストグラデーションの色補間
背景をグラデーションにし、 background-clip:text で文字の形に切り抜く CSS .gradient-text { /* 背景グラデーション */ background:
linear-gradient(-45deg, #2af598, #009efd); /* テキスト色を透明 */ color: transparent; /* 背景を文字の形で切り抜く */ background-clip: text; } 【イマドキ】 background-clip:text
linear-gradient(blue, red) のような記述では、 blueとredの中間色がsRGB空間で補間される sRGB補間は人間の目には均等ではなく、暗くなったように見え る linear-gradient(blue, red)は中央色が暗くなる
linear-gradient(in oklch, red, blue); のように in oklch を明示すると「OKLCH」で補間される OKLCHは人間の目に均等で、 彩度が保たれたまま鮮やかなグラデーションになる
【イマドキ】 「OKLCH」で補間する
人間の目に均等な色空間。 3 つの値で色を表す。 L(明度)— 明るさ C(彩度)— 鮮やかさ H(色相)— 色味(角度) oklch()
で色指定にも使える CSS color: oklch(0.62 0.22 264) /* 青 */ color: oklch(0.72 0.22 330) /* ピンク */ OKLCHとは
CSS /* Tailwind v4 のカラーパレット定義 */ --color-red-500: oklch(63.7% 0.237 25.331);
--color-blue-500: oklch(62.3% 0.214 259.815); 採用理由: 広色域 — sRGB の限界を超え、より鮮やかな色を表現 グラデ補間が綺麗 — 中間色がくすまない(既定で OkLAB 補間) 知覚的均等性 — 50 〜 950 のスケールが等間隔に見える Tailwind CSS v4 が OKLCH を全面採用 https://tailwindcss.com/blog/tailwindcss-v4
ブラウザ バージョン リリース日 Chrome / Edge 111 2023年3月 Safari 16.4
2023年3月 Firefox 113 2023年5月 Baseline 2023 — Newly available oklch() のブラウザ対応状況 https://caniuse.com/css-color-mix
02 要素の位置を基準に ポップオーバーを表示する anchor-position + popover
Demo
JavaScript const button = document.querySelector('.trigger'); const popover = document.querySelector('.popover'); const
close = () => popover.classList.remove('open'); button.addEventListener('click', () => popover.classList.toggle('open')); document.addEventListener('keydown', (e) => e.key === 'Escape' && close()); document.addEventListener('click', (e) => !popover.contains(e.target) && !button.contains(e.target) && close()); 【従来】 Popoverを作るのは大変だった
クリックで開く ESC・背景クリックで閉じる 適切なフォーカス HTML <button commandfor="my-popover" command="toggle-popover">開く</button> <div id="my-popover" popover>
<p>ポップオーバーの内容</p> </div> 【イマドキ】 Popover APIで表示・非表示が簡単に
position: fixed ウインドウの絶対位置で配置 要素を基準にできない JavaScript 煩雑 function updatePosition() { const
rect = button.getBoundingClientRect(); popover.style.top = `${rect.bottom + 8}px`; popover.style.left = `${rect.left}px`; } 【従来】 ポップオーバーの位置指定手段が煩雑
HTMLでポップオーバーの基準となる要素を指定する (anchor-name ) HTML <button class="button" commandfor="my-popover" command="toggle-popover">開く</button> .button {
anchor-name: --my-anchor; } 【イマドキ】CSS Anchor Positioningで位置指定①
ポップオーバーをアンカー要素と紐づけ(position-anchor ) アンカーからの位置を指定(anchor または position-area ) HTML <div id="my-popover" popover
class="popover">ポップオーバー</div> CSS .popover { position-anchor: --my-anchor; top: anchor(bottom); /* アンカーの下端 */ left: anchor(left); /* アンカーの左端 */ } 【イマドキ】CSS Anchor Positioningで位置指定②
CSS .tip { position: absolute; position-anchor: --my-btn; position-area: bottom; /*
はみ出したら反対側へ自動的に配置を試す */ position-try-fallbacks: flip-block, flip-inline; } flip-block :ブロック軸(縦)方向に反転 flip-inline :インライン軸(横)方向に反転 flip-start :対角軸で反転(block/inline 軸を入れ替え) position-try-fallbacks で画面端の自動回避
ブラウザ バージョン リリース日 Chrome 125 2024年5月 Edge 125 2024年5月 Safari
26 2025年9月 Firefox 147 2026年1月 Baseline 2026 — Newly available anchor-position のブラウザ対応状況 https://caniuse.com/css-anchor-positioning
ブラウザ バージョン リリース日 Chrome / Edge 114 2023年5月 Safari 17.0
2023年9月 Firefox 125 2024年4月 Baseline 2024 — Newly available Popover API のブラウザ対応状況 https://caniuse.com/mdn-html_global_attributes_popover
03 JavaScriptなしでdialogやpopoverを開閉す る commandfor , command 属性(Invoker Commands)
Demo
dialog・popoverの開閉デモ
専用属性の popovertarget やpopovertargetaction を使う HTML <button popovertarget="menu" popovertargetaction="toggle">ボタン</button> <div id="menu"
popover>...</div> 【従来】popoverは専用属性で操作
属性で開閉する手段はなく、JavaScriptで開閉していた HTML <button id="open">開く</button> <dialog id="dlg">...</dialog> JavaScript open.addEventListener("click", () =>
{ dlg.showModal(); }); 【従来】dialogはJavaScriptで開閉する必要があった
popoverもdialogもcommand 属性とcommandfor 属性で制御 popover HTML <button commandfor="menu" command="toggle-popover">メニュー</button> <div id="menu"
popover>...</div> dialog HTML <button commandfor="dlg" command="show-modal">開く</button> <dialog id="dlg">...</dialog> 【イマドキ】command + commandfor に統一
popover 専用 command 値 用途 show-popover popover を開く hide-popover popover
を閉じる toggle-popover popover をトグル <dialog> 専用 command 値 用途 show-modal dialog をモーダル表示 close dialog を閉じる request-close dialog に閉じる要求を送る command 属性で指定できる値
dialogもpopoverも、表示・非表示がdisplay: none と display: block という「離散プロパティ」の値が切り替わる @starting-style とallow-discrete を使うことで、 表示・非表示時のアニメーションができる
非表示のアニメーションはFirefox"以外"で対応 dialog, popoverの表示・非表示アニメーション
CSS .dialog { display: none; opacity: 0; transition: 0.4s allow-discrete;
} .dialog[open] { display: block; opacity: 1; @starting-style { opacity: 0; } } [open] 属性で 表示状態のスタイルを指定 表示時 @starting-style の効果で アニメーション 非表示時 allow-discrete の効果で アニメーション ※ 非表示アニメーションは Firefox以外対応 dialogの開閉アニメーション
CSS .theme-menu { opacity: 0; transform: translateY(-4px); transition: 0.15s allow-discrete;
} .theme-menu:popover-open { opacity: 1; transform: translateY(0); @starting-style { opacity: 0; transform: translateY(-4px); } } :popover-open 擬似クラスで 表示状態のスタイルを指定 表示時 @starting-style の効果で アニメーション 非表示時 allow-discrete の効果で アニメーション ※ 非表示アニメーションは Firefox以外対応 popoverの開閉アニメーション
ブラウザ バージョン リリース日 Chrome / Edge 135 2025年4月 Firefox 144
2025年10月 Safari 26.2 2025年12月 Baseline 2025 — Newly available Invoker Commands のブラウザ対応状況 https://caniuse.com/mdn-html_elements_button_command
04 行列を入れ子にしたい subgrid
デモ: カードデザインの各要素の高さを揃える
<a href="#" class="card"> <div class="thumb"> <img src="./画像.png" /> </div> <time
class="date">2026年5月14日</time> <h3 class="title">鹿野さんに聞く!CSSの最新トレンド Ver.2026</h3> <div class="foot-row"> <button>参加申し込み</button> </div> </a> HTML
4行の親行列をつくる 子行列を配置する 子行列の行は、親の行に一致させる 【イマドキ】 行列を入れ子にする
CSS .grid { display: grid; grid-template-columns: repeat(2, 1fr); } .card
{ display: grid; grid-template-rows: subgrid; grid-row: span 4; } 2列の行列を作り、子を配置 タイトルの長さが違っても、サムネ・日付・タイトル・ボタンの行位置が揃う
それぞれの行で高さが揃う カード自体が複数行に配置されてもOK
ブラウザ バージョン リリース日 Firefox 71 2019年12月 Safari 16.0 2022年9月 Chrome
/ Edge 117 2023年9月 Baseline 2023 — Newly available subgrid のブラウザ対応状況 https://caniuse.com/css-subgrid
本日紹介したモダンCSS 03 まとめ
1. グラデーションをきれいに見せる oklch background-clip: text 2. 要素を基準にポップオーバーを表示する anchor-position popover 3.
JavaScriptなしでdialog・popoverを開閉する command commandfor 4. 行列を入れ子にする subgrid 本日紹介したモダンCSS
新しい知識を取り入れて 楽しくラクにウェブ制作をしましょう
None