このドキュメントは、KDE PlasmaのBreezeテーマを模倣したCSSライブラリ kde-plasma.css のリファレンスです。
各UIコンポーネントの基本的な思想、デザインガイドライン、HTML構造例、および適用されるCSSスニペットを提供します。
KDE Plasma の Breeze UI は以下の思想で構成される:
CSSでは「透明・影・境界線の階層」を正確に再現することが重要です。
主要な色、角丸、影の値はCSS変数として定義されており、テーマの一貫性を保ち、変更を容易にしています。
:root {
/* Colors */
--plasma-blue: #3daee9;
--plasma-bg-window: rgba(255, 255, 255, 0.85);
--plasma-bg-titlebar: rgba(255, 255, 255, 0.6);
--plasma-bg-button: #eff0f1;
--plasma-bg-panel: rgba(255, 255, 255, 0.5);
--plasma-border-light: #cfd3d6;
--plasma-border-titlebar: #d7dbde;
--plasma-border-button: #bfc4c6;
--plasma-border-btn-control: rgba(0, 0, 0, 0.2);
--plasma-text-dark: #232629;
--plasma-shadow-color: rgba(0, 0, 0, 0.25);
/* Radii */
--plasma-radius-window: 6px;
--plasma-radius-button: 4px;
--plasma-radius-input: 4px;
--plasma-radius-checkbox: 3px;
/* Shadows */
--plasma-box-shadow: 0 8px 24px var(--plasma-shadow-color);
}
.window)KDE Plasmaのウィンドウは、透明感、柔らかい影、控えめな角丸が特徴です。
ウィンドウコンテンツの例。
<div class="window">
<div class="title-bar">
<div class="title-bar-text">Window Title</div>
<div class="title-bar-controls">
<button aria-label="Minimize"></button>
<button aria-label="Maximize"></button>
<button aria-label="Close"></button>
</div>
</div>
<div class="window-body">
<!-- UI content -->
</div>
</div>
.window {
background: var(--plasma-bg-window);
border: 1px solid var(--plasma-border-light);
border-radius: var(--plasma-radius-window);
box-shadow: var(--plasma-box-shadow);
backdrop-filter: blur(12px);
overflow: hidden;
}
.panel)画面下部に固定されるタスクバーを模倣したパネルです。半透明とぼかしが特徴です。
<div class="panel bottom">
<div class="start-menu-button">...</div>
<div class="task-manager">...</div>
<div class="system-tray">...</div>
</div>
.panel {
background: var(--plasma-bg-panel);
backdrop-filter: blur(10px);
border-top: 1px solid var(--plasma-border-titlebar);
padding: 6px;
box-shadow: 0 0px 5px rgba(0, 0, 0, 0.2);
}
.input)Breezeテーマに合わせた清潔感のある入力欄です。フォーカス時に青いシャドウが表示されます。
<input type="text" class="input" placeholder="Type something...">
.input {
background: #ffffff;
border: 1px solid var(--plasma-border-button);
border-radius: var(--plasma-radius-input);
padding: 6px;
color: var(--plasma-text-dark);
}
.input:focus {
border-color: var(--plasma-blue);
box-shadow: 0 0 0 2px rgba(61,174,233,0.3);
}
.checkbox-container)カスタムスタイリングされたチェックボックスです。Breezeテーマの色と角丸を反映しています。
<label class="checkbox-container">
<input type="checkbox" checked="checked">
<span class="checkmark"></span> Checked
</label>
.checkbox-container { display: block; position: relative; padding-left: 25px; cursor: pointer; }
.checkbox-container input { opacity: 0; position: absolute; }
.checkmark {
position: absolute; top: 0; left: 0; height: 16px; width: 16px;
background: #fff; border: 1px solid var(--plasma-border-button);
border-radius: var(--plasma-radius-checkbox);
}
.checkbox-container input:checked ~ .checkmark { background: var(--plasma-blue); border-color: var(--plasma-blue); }
.checkmark:after { /* Checkmark icon */ }
.checkbox-container input:checked ~ .checkmark:after { display: block; }
.radio-container)カスタムスタイリングされたラジオボタンです。チェックボックスと同様の美学に従います。
<label class="radio-container">
<input type="radio" checked="checked" name="my-radio-group">
<span class="radiomark"></span> Option
</label>
.radio-container { display: block; position: relative; padding-left: 25px; cursor: pointer; }
.radio-container input { opacity: 0; position: absolute; }
.radiomark {
position: absolute; top: 0; left: 0; height: 16px; width: 16px;
background: #fff; border: 1px solid var(--plasma-border-button);
border-radius: 50%;
}
.radio-container input:checked ~ .radiomark { background: var(--plasma-blue); border-color: var(--plasma-blue); }
.radiomark:after { /* Inner circle */ }
.radio-container input:checked ~ .radiomark:after { display: block; }
.slider)Breezeテーマのシンプルな横型スライダーです。
<input type="range" min="0" max="100" value="50" class="slider">
.slider { -webkit-appearance: none; width: 100%; height: 8px; background: #d3d3d3; }
.slider::-webkit-slider-thumb {
-webkit-appearance: none; appearance: none; width: 16px; height: 16px;
border-radius: 50%; background: var(--plasma-blue); cursor: pointer;
}
.tooltip-container)ホバー時に表示されるシンプルなツールチップです。
<span class="tooltip-container">Hover over me
<span class="tooltip-text">This is a tooltip!</span>
</span>
.tooltip-container { position: relative; display: inline-block; cursor: help; }
.tooltip-text {
visibility: hidden; width: 160px; background-color: rgba(50, 50, 50, 0.9);
color: #fff; text-align: center; border-radius: var(--plasma-radius-button);
padding: 5px 0; position: absolute; opacity: 0;
}
.tooltip-container:hover .tooltip-text { visibility: visible; opacity: 1; }
.tab-container)シンプルなタブインターフェースです。アクティブなタブが強調表示されます。
Content for Tab 1
<div class="tab-container">
<div class="tab-bar">
<button class="tab-item active">Tab 1</button>
<button class="tab-item">Tab 2</button>
</div>
<div class="tab-content">
<p>Content for Tab 1</p>
</div>
</div>
.tab-container { border: 1px solid var(--plasma-border-light); border-radius: var(--plasma-radius-window); }
.tab-bar { display: flex; border-bottom: 1px solid var(--plasma-border-light); }
.tab-item { padding: 8px 15px; cursor: pointer; background: transparent; border: none; }
.tab-item.active { background: var(--plasma-blue); color: white; border-bottom: 2px solid var(--plasma-blue); }
.list-view)シンプルなリスト表示コンポーネントです。アクティブなアイテムが青色で強調表示されます。
<div class="list-view">
<div class="list-item active">List Item 1</div>
<div class="list-item">List Item 2</div>
</div>
.list-view { border: 1px solid var(--plasma-border-light); border-radius: var(--plasma-radius-window); }
.list-item { padding: 8px 12px; color: var(--plasma-text-dark); border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
.list-item:hover { background-color: rgba(0, 0, 0, 0.05); }
.list-item.active { background: var(--plasma-blue); color: white; }
WebKitブラウザ向けのカスタムスクロールバーです。
Scrollable content example...
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<div style="height: 100px; overflow-y: scroll;">
<p>Scrollable content...</p>
</div>
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); border-radius: 5px; }
::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.3); border-radius: 5px;
border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.5); }
.dialog-overlay)KDE Plasma風のモーダルダイアログボックスです。半透明のオーバーレイとぼかしが特徴です。
<div class="dialog-overlay">
<div class="dialog-box">
<div class="dialog-header">
<span class="dialog-title">System Message</span>
<span class="btn close dialog-close"></span>
</div>
<div class="dialog-content">
<p>これはKDE Plasma風のダイアログボックスです。</p>
</div>
<div class="dialog-footer buttons">
<button class="button">Cancel</button>
<button class="button primary">OK</button>
</div>
</div>
</div>
.dialog-overlay {
position: fixed; top: 0; left: 0; width: 100%; height: 100%;
background: rgba(0, 0, 0, 0.5); display: flex;
justify-content: center; align-items: center; z-index: 2000;
}
.dialog-box {
background: var(--plasma-bg-window); border: 1px solid var(--plasma-border-light);
border-radius: var(--plasma-radius-window); box-shadow: var(--plasma-box-shadow);
backdrop-filter: blur(12px); width: 400px; overflow: hidden;
}
.dialog-header {
background: var(--plasma-bg-titlebar); border-bottom: 1px solid var(--plasma-border-titlebar);
padding: 8px 12px; display: flex; align-items: center; justify-content: space-between;
}
.dialog-footer {
border-top: 1px solid var(--plasma-border-light); padding: 10px 15px;
display: flex; justify-content: flex-end; gap: 10px;
}
.toast-container)システム通知などに使用される、画面端に表示される一時的なメッセージです。
<div class="toast-container top-right">
<div class="toast-message">
<p>これはKDE Plasma風の通知です!</p>
<span class="btn close toast-close"></span>
</div>
</div>
.toast-container { position: fixed; z-index: 3000; padding: 15px; display: flex; }
.toast-container.top-right { top: 0; right: 0; align-items: flex-end; }
.toast-message {
background: rgba(50, 50, 50, 0.9); color: white; border-radius: var(--plasma-radius-button);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); padding: 10px 15px; display: flex;
}
.toast-message .btn.close {
background: transparent; border: none; color: white; width: 20px; height: 20px;
}
.spinner)処理中であることを示すローディングインジケーターです。
<div class="spinner"></div>
.spinner {
display: inline-block; width: 30px; height: 30px;
border: 3px solid rgba(0, 0, 0, 0.3); border-radius: 50%;
border-top-color: var(--plasma-blue);
animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }