- 最終更新
- 2026/08/17
3秒でわかる
単語をハイフンでつなぐ命名規則。my-project のような形で、CSSのクラス名やURL、ファイル名で標準的に使われます。
30秒図解
もう少し詳しく
どういうものか
ケバブケースは、user-profile-card main-navigation 2026-08-14-release-note のような
使われる
なぜ必要か
ハイフンがmy-value と
具体例
同じ
/* CSSのクラスとカスタムプロパティはケバブケース */
.user-profile-card {
--card-padding: 16px;
padding: var(--card-padding);
}<!-- 属性名もケバブケース。JSからは userId として読む -->
<div class="user-profile-card" data-user-id="42"></div>// JavaScriptの変数はキャメルケース
const userProfileCard = document.querySelector(".user-profile-card");
const id = userProfileCard.dataset.userId;data-user-id が JavaScript 側で dataset.userId に
似た用語との違い
| 記法 | 書き方 | 主な使い先 |
|---|---|---|
| ケバブケース | user-profile | CSSクラス、 |
| キャメルケース | userProfile | JavaScriptや |
| スネークケース | user_profile | Pythonの |
| パスカルケース | UserProfile | クラス名、 |
つまずきやすいところ
Reactで class のclassName をbackground-color は書けず、backgroundColor に
もう


