diff --git a/docs/dev-notes/2025-11-02/make-button-group-responsive/plan.md b/docs/dev-notes/2025-11-02/make-button-group-responsive/plan.md new file mode 100644 index 000000000..ffb0f4842 --- /dev/null +++ b/docs/dev-notes/2025-11-02/make-button-group-responsive/plan.md @@ -0,0 +1,67 @@ +# Button Group のレスポンシブ化 + +## 問題 + +640px未満の画面でボタングループの文字が縦に潰れてしまう + +## 解決方法 + +Tailwind CSSのレスポンシブクラスを使用してボタンの折り返しと配置を実装 + +## コード変更 + +### 修正前 + +```svelte + +``` + +### 修正後 + +```svelte +
+ + {#each Object.entries(contestTableProviderGroups) as [type, config]} + + {/each} + +
+``` + +## 使用クラス一覧 + +| クラス | 役割 | +| ---------------- | ------------------------------------------- | +| `flex` | Flexboxコンテナを有効化 | +| `flex-wrap` | 画面幅に応じてボタンを折り返す | +| `justify-center` | ボタングループ全体を水平中央揃え(外側div) | +| `justify-start` | ボタン自体を左寄せ(ButtonGroup内) | +| `gap-1` | ボタン間のスペーシング(0.25rem) | +| `rounded-lg` | ボタンの角に丸みを付与 | +| `shadow-none` | デフォルトシャドウを削除 | + +## 注記 + +`ButtonGroup`コンポーネントのデフォルトスタイルにシャドウが含まれているため、`shadow-none`クラスを追加してそれらを打ち消す必要があります。 + +## 参考資料 + +- [Tailwind CSS - Flex Wrap](https://tailwindcss.com/docs/flex-wrap) +- [Tailwind CSS - Justify Content](https://tailwindcss.com/docs/justify-content) +- [Tailwind CSS - Gap](https://tailwindcss.com/docs/gap) +- [Tailwind CSS - Border Radius](https://tailwindcss.com/docs/border-radius) +- [Tailwind CSS - Box Shadow](https://tailwindcss.com/docs/box-shadow) + +## 使用ライブラリ + +- Tailwind CSS +- Flowbite +- svelte-5-ui-lib diff --git a/src/lib/components/TaskTables/TaskTable.svelte b/src/lib/components/TaskTables/TaskTable.svelte index 0bd75c523..a26bfa4e2 100644 --- a/src/lib/components/TaskTables/TaskTable.svelte +++ b/src/lib/components/TaskTables/TaskTable.svelte @@ -171,19 +171,23 @@ - - {#each Object.entries(contestTableProviderGroups) as [type, config]} - - {/each} - +
+ + {#each Object.entries(contestTableProviderGroups) as [type, config]} + + {/each} + +