elite-layouts について
現代的なウェブレイアウトのパターンを選び、実装するためのリファレンススキルです。デザイナーや開発者向けに、グリッド、横スクロール、スティッキーパララックス、コンテナークエリー、レスポンシブ設計をアクセシビリティや性能の観点も含めて解説します。
主な機能
- 01Bento とエディトリアルグリッドのパターン
- 02横スクロールレイアウト
- 03スティッキーとパララックスのセクション
- 04コンテナークエリーの指針
- 05レスポンシブでコンテンツに応じたレイアウト
- 06アクセシビリティと性能の実践
活用シーン
- 01ランディングページのレイアウト設計
- 02レスポンシブな商品グリッドの構築
- 03ダッシュボードのパネルやウィジェット設計
- 04エディトリアルや雑誌ページの制作
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ rshvr/ elite-web-design --skill elite-layoutsインストール後、Claude Code で/elite-layoutsを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
references/bento-grids.mdcontainer-queries.mdeditorial-patterns.mdhorizontal-scroll.mdsticky-parallax.md詳細
エリートなレイアウト
現代の受賞サイトを特徴づける、プレミアムなレイアウトパターンです。
クイックリファレンス
| トピック | 参照ファイル |
|---|---|
| ベントーグリッド | bento-grids.md |
| 水平スクロール | horizontal-scroll.md |
| スティッキーとパララックス | sticky-parallax.md |
| コンテナクエリ | container-queries.md |
| エディトリアルパターン | editorial-patterns.md |
レイアウト選択フレームワーク
プロジェクトの種類別
| プロジェクト | 主なレイアウト | 主なパターン |
|---|---|---|
| ポートフォリオ | ベントー+水平スクロール | 注目作品、ケーススタディ |
| E コマース | コンテナクエリ | 商品グリッド、レスポンシブカード |
| ランディングページ | スティッキーパララックス | ヒーロー → 特徴 → CTA の流れ |
| ダッシュボード | ベントー+コンテナ | サイズ変更可能なパネル、ウィジェット |
| ブログ/雑誌 | 非対称グリッド | エディトリアルな印象、視覚的階層 |
| エージェンシー | 水平スクロール+ベントー | 没入感があり、探索的 |
パターンの選択
Need adaptive components? → Container Queries
Need visual interest/variety? → Bento Grids
Need immersive storytelling? → Horizontal Scroll
Need depth/layering? → Sticky Parallax
Need all of the above? → Combine strategically
コアグリッドシステム
12 カラムの基盤
.container {
--columns: 12;
--gutter: clamp(1rem, 2vw, 2rem);
--margin: clamp(1rem, 5vw, 6rem);
display: grid;
grid-template-columns:
[full-start] var(--margin)
[content-start] repeat(var(--columns), 1fr)
[content-end] var(--margin)
[full-end];
gap: var(--gutter);
}
/* Full-bleed items */
.full-bleed {
grid-column: full-start / full-end;
}
/* Content-width items */
.content {
grid-column: content-start / content-end;
}
/* Responsive columns */
@media (max-width: 768px) {
.container {
--columns: 4;
--margin: 1rem;
}
}
スパンユーティリティ
/* Column spans */
.col-span-1 {
grid-column: span 1;
}
.col-span-2 {
grid-column: span 2;
}
.col-span-3 {
grid-column: span 3;
}
.col-span-4 {
grid-column: span 4;
}
.col-span-6 {
grid-column: span 6;
}
.col-span-8 {
grid-column: span 8;
}
.col-span-12 {
grid-column: span 12;
}
/* Row spans */
.row-span-2 {
grid-row: span 2;
}
.row-span-3 {
grid-row: span 3;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.col-span-6,
.col-span-4 {
grid-column: span 4; /* Full width on mobile */
}
}
ベントーグリッドのクイックスタート
.bento-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-auto-rows: minmax(200px, auto);
gap: 1rem;
}
/* Feature item - large */
.bento-item.featured {
grid-column: span 2;
grid-row: span 2;
}
/* Tall item */
.bento-item.tall {
grid-row: span 2;
}
/* Wide item */
.bento-item.wide {
grid-column: span 2;
}
@media (max-width: 768px) {
.bento-grid {
grid-template-columns: repeat(2, 1fr);
}
.bento-item.featured,
.bento-item.wide {
grid-column: span 2;
}
}
高度なパターンについては、bento-grids.md を参照してください。
水平スクロールのクイックスタート
CSS のみ(scroll-snap)
.horizontal-scroll {
display: flex;
overflow-x: auto;
scroll-snap-type: x mandatory;
scrollbar-width: none;
}
.horizontal-scroll::-webkit-scrollbar {
display: none;
}
.horizontal-section {
flex: 0 0 100vw;
min-width: 100vw;
height: 100vh;
scroll-snap-align: start;
}
GSAP ScrollTrigger(ピン留め)
gsap.to(".horizontal-track", {
x: () =>
-(
document.querySelector(".horizontal-track").scrollWidth -
window.innerWidth
),
ease: "none",
scrollTrigger: {
trigger: ".horizontal-container",
pin: true,
scrub: 1,
end: () => `+=${document.querySelector(".horizontal-track").scrollWidth}`,
},
});
完全なパターンについては、horizontal-scroll.md を参照してください。
スティッキーパララックスのクイックスタート
CSS スティッキーセクション
.sticky-container {
position: relative;
}
.sticky-section {
position: sticky;
top: 0;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
/* Stack sections with z-index */
.sticky-section:nth-child(1) {
z-index: 1;
background: var(--color-bg-1);
}
.sticky-section:nth-child(2) {
z-index: 2;
background: var(--color-bg-2);
}
.sticky-section:nth-child(3) {
z-index: 3;
background: var(--color-bg-3);
}
GSAP のピン留めとアニメーション
gsap
.timeline({
scrollTrigger: {
trigger: ".pinned-section",
pin: true,
scrub: 1,
start: "top top",
end: "+=200%",
},
})
.from(".content-1", { opacity: 0, y: 50 })
.from(".content-2", { opacity: 0, y: 50 })
.from(".content-3", { opacity: 0, y: 50 });
レイヤー効果については、sticky-parallax.md を参照してください。
コンテナクエリのクイックスタート
/* Define containment */
.card-container {
container-type: inline-size;
container-name: card;
}
/* Base styles */
.card {
display: flex;
flex-direction: column;
padding: 1rem;
}
/* Respond to container width */
@container card (min-width: 400px) {
.card {
flex-direction: row;
gap: 1.5rem;
}
.card-image {
flex: 0 0 40%;
}
}
@container card (min-width: 600px) {
.card {
padding: 2rem;
}
.card-title {
font-size: 1.5rem;
}
}
高度なパターンについては、container-queries.md を参照してください。
レイアウトとアニメーションの統合
グリッド項目のアニメーション化
/* Hide items ONLY when scroll-driven animation is supported AND motion is
allowed. If either is false, items render visible by default — so Firefox
(still flag-gated in 2026) and reduced-motion users are never stranded at
opacity: 0 with no timeline to reveal them. Feature-detect view()
specifically because it's the timeline this reveal uses. */
@supports (animation-timeline: view()) {
@media (prefers-reduced-motion: no-preference) {
.grid-item {
opacity: 0;
transform: translateY(30px);
animation: revealItem linear both;
animation-timeline: view();
animation-range: entry 0% cover 30%;
}
}
}
@keyframes revealItem {
to {
opacity: 1;
transform: none;
}
}
GSAP グリッドアニメーション
gsap.from(".grid-item", {
opacity: 0,
y: 50,
stagger: {
amount: 0.8,
grid: "auto",
from: "start",
},
scrollTrigger: {
trigger: ".grid-container",
start: "top 80%",
},
});
レイアウト変更に FLIP を使用
// Before layout change
const state = Flip.getState(".grid-item");
// Change layout (filter, sort, resize)
filterItems();
// Animate the change
Flip.from(state, {
duration: 0.6,
ease: "power2.inOut",
stagger: 0.05,
absolute: true,
});
レスポンシブ戦略
モバイルファーストのブレークポイント
/* Mobile: 1 column */
.layout {
display: grid;
grid-template-columns: 1fr;
gap: 1rem;
padding: 1rem;
}
/* Tablet: 2 columns */
@media (min-width: 640px) {
.layout {
grid-template-columns: repeat(2, 1fr);
gap: 1.5rem;
padding: 2rem;
}
}
/* Desktop: 3+ columns */
@media (min-width: 1024px) {
.layout {
grid-template-columns: repeat(3, 1fr);
gap: 2rem;
padding: 3rem;
}
}
/* Large: 4 columns */
@media (min-width: 1280px) {
.layout {
grid-template-columns: repeat(4, 1fr);
}
}
流動的なレイアウト(ブレークポイントなし)
/* Auto-fit columns */
.fluid-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
gap: clamp(1rem, 3vw, 2rem);
}
/* Fluid spacing */
.section {
padding-block: clamp(3rem, 10vh, 8rem);
padding-inline: clamp(1rem, 5vw, 6rem);
}
:has() によるコンテンツ対応レイアウト
ビューポートだけでなく、_コンテンツ_に応じて変化するレイアウトです。:has() は主要ブラウザーすべてで Baseline に対応済み(2023 年後半以降)で、フォールバックは不要です。
/* Quantity queries: the grid restructures as items are added */
.card-grid {
display: grid;
grid-template-columns: 1fr;
gap: 1.5rem;
}
.card-grid:has(> :nth-child(2)) {
grid-template-columns: repeat(2, 1fr);
}
.card-grid:has(> :nth-child(4)) {
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
/* Give an article a sidebar only when it actually contains a figure */
.article:has(> figure) {
grid-template-columns: 1fr 320px;
}
/* Collapse a section's chrome when it has no items (empty state) */
.gallery:not(:has(.gallery-item)) {
display: none;
}
子要素を数えてクラスを切り替える JavaScript より、こちらを優先してください。宣言的で、DOM に合わせて自動的に再レイアウトされ、実行時コストもゼロです。
よく使われるレイアウトパターン
ヒーロー+コンテンツグリッド
.hero-layout {
display: grid;
grid-template-rows: 100vh auto;
}
.hero {
display: grid;
place-items: center;
position: relative;
}
.content-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
padding: clamp(2rem, 5vw, 4rem);
}
サイドバー+メイン
.sidebar-layout {
display: grid;
grid-template-columns: minmax(250px, 300px) 1fr;
min-height: 100vh;
}
@media (max-width: 768px) {
.sidebar-layout {
grid-template-columns: 1fr;
}
.sidebar {
position: fixed;
inset: 0;
transform: translateX(-100%);
transition: transform 0.3s ease;
}
.sidebar.open {
transform: translateX(0);
}
}
メイソンリー
ネイティブメイソンリーが登場しつつあります。Safari 26.4 が最初に対応し(2026 年)、Chrome と Firefox はフラグ付きの段階で、2026 年を通じて安定化が進んでいます。構文はまだ定まっていません(grid-template-rows: masonry と、新しい display: grid-lanes/Item Flow 提案のどちらになるか)。そのため、機能検出を行い、バージョン判定は決して行わず、本番環境では以下の JS フォールバックを維持してください。
/* Enhancement: native masonry where supported */
.masonry {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 1rem;
}
@supports (grid-template-rows: masonry) {
.masonry {
grid-template-rows: masonry; /* rows pack tightly up each column */
}
}
フォールバック(現時点で本番環境でも安全)
固定高の行と JS で計算したスパンを使うグリッドは、現在すべての環境で動作します。
.masonry-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
grid-auto-rows: 10px;
gap: 1rem;
}
.masonry-item {
/* Set via JS based on content height */
grid-row-end: span var(--row-span, 20);
}
// Calculate row spans based on content
function setMasonrySpans() {
const grid = document.querySelector(".masonry-grid");
const rowHeight = 10;
const gap = 16;
grid.querySelectorAll(".masonry-item").forEach((item) => {
const content = item.querySelector(".content");
const span = Math.ceil((content.offsetHeight + gap) / (rowHeight + gap));
item.style.setProperty("--row-span", span);
});
}
パフォーマンスに関する考慮事項
レイアウトの封じ込め
/* Isolate layout calculations */
.grid-item {
contain: layout style;
}
/* Full containment for complex items */
.complex-card {
contain: strict;
content-visibility: auto;
contain-intrinsic-size: 300px;
}
レイアウトスラッシングの回避
// BAD: Forces layout per item
items.forEach((item) => {
item.style.width = item.offsetWidth + 10 + "px";
});
// GOOD: Batch reads, then writes
const widths = items.map((item) => item.offsetWidth);
items.forEach((item, i) => {
item.style.width = widths[i] + 10 + "px";
});
CSS Grid と Flexbox
| Grid を使う場合 | Flexbox を使う場合 |
|---|---|
| 2 次元レイアウト | 1 次元レイアウト |
| 構造が決まっている | 項目数が不明 |
| 項目を重ねる | コンテンツの配置 |
| 雑誌/ベントー | ナビゲーション、カード |
| 複雑な配置 | シンプルな配置 |
アクセシビリティ
水平セクションのスキップ
<a href="#after-horizontal" class="skip-link">
Skip horizontal scroll section
</a>
<section class="horizontal-scroll" aria-label="Project gallery">
</section>
<div id="after-horizontal"></div>
キーボードナビゲーション
// Allow arrow key navigation in horizontal scroll
horizontalContainer.addEventListener("keydown", (e) => {
if (e.key === "ArrowRight") {
horizontalContainer.scrollBy({
left: window.innerWidth,
behavior: "smooth",
});
}
if (e.key === "ArrowLeft") {
horizontalContainer.scrollBy({
left: -window.innerWidth,
behavior: "smooth",
});
}
});
レイアウト変更の通知
// For dynamic layout changes (filtering)
const liveRegion = document.getElementById("live-region");
liveRegion.textContent = `Showing ${visibleItems.length} of ${totalItems} items`;
読み上げ順を同期する
名前付きエリア、order、grid-row/grid-columnによるグリッド配置で、アイテムがDOM順から移動すると、キーボードユーザーやスクリーンリーダーのユーザーは引き続きソース順にたどるため、WCAG 2.4.3(フォーカス順序)に違反します。長期的な解決策は、DOM順を主要な視覚上の順序に合わせることです。プログレッシブエンハンスメントとして、reading-flow(2026年時点でChrome 137以降、Chromiumのみ)を使うと、フォーカス順/読み上げ順を視覚上のフローに合わせられます。
.bento-grid {
display: grid;
reading-flow: grid-order; /* focus follows visual grid order where supported */
}
適切なソース順序の代わりではなく、機能強化として扱ってください。