
言語 🇯🇵 日本語
はじめに
ウィジェットのスタイリング
その他のフロントエンドライブラリ
カスタムスタイリングガイド
このガイドは、FastComments コメントウィジェット (v2) で使用される完全なデフォルト CSS と、スタイルを上書きするためのいくつかの手順を提供します。
デフォルトの CSS を理解することで、次のことが可能になります:
- 特定のスタイルを上書きして外観をカスタマイズする
- 使用可能なクラスやセレクタを確認してスタイリングの問題をトラブルシュートする
- ウィジェットの構造に合ったカスタムテーマを作成する
- AI アシスタントと組み合わせてカスタム CSS の変更を生成する
How to Override Styles
スタイルの上書き方法はウィジェットによって異なります。コメントウィジェットの場合、CSS を iframe に渡すには customCSS 設定パラメータを使用するか、管理ダッシュボードのカスタマイズページに CSS を指定して当社の CDN から CSS を配信する必要があります。
スタイルのカスタマイズ方法 
コメントウィジェットのスタイルをカスタマイズする方法
コメントウィジェットのスタイリングは、次の2つの方法でカスタマイズできます:
オプション 1: customCSS パラメータで
ウィジェットを初期化するときに、カスタムCSSを文字列として customCSS パラメータに渡します:
window.fcConfigs = [{
target: '#fastcomments-widget',
tenantId: 'your-tenant-id',
customCSS: `
.fast-comments .comment {
background-color: #f0f0f0 !important;
border-radius: 8px !important;
}
`
}];
オプション 2: 管理ダッシュボードから
- 管理ダッシュボードのウィジェットのカスタマイズページに移動
- 「詳細」内の「カスタム CSS」セクションまでスクロール
- カスタム CSS を入力
- 「保存」をクリック
入力したカスタム CSS は、サイト上のすべてのコメントウィジェットに適用されます。
ヒント
- 必要に応じてデフォルトのスタイルを上書きするために
!importantを使用してください - サイトの他の部分に影響を与えないよう、特定のセレクタを指定してください
- 互換性のために、異なるブラウザで CSS をテストしてください
- ウィジェットは標準の CSS を使用します — 特別なプリプロセッサは不要です
コメントボックスの枠線をカスタマイズする 
The border around the comment box is made of the text area's own border plus a few thin lines the widget draws around it. To change its color or corner roundness, set these CSS variables instead of styling the textarea directly. The variables restyle every part of the border at once, so the corners and colors always line up.
| 変数 | 変更内容 | デフォルト |
|---|---|---|
--fc-input-border-color | 枠線の色 | #bfbfbf |
--fc-input-border-color-focus | ユーザーが入力中の枠線の色 | #555 |
--fc-input-border-radius | 角の丸み | 11px |
--fc-input-border-start-start-radius | 正方形の左上隅の丸み(右から左の言語では右上) | 0 |
Add the CSS to the Custom CSS box on the Widget Customization page, or pass it with the customCSS option. You only need to set the variables you want to change.
You can also use the Comment box border helper right under the Custom CSS box, which writes this CSS for you.
Change the Border Color

Change the Border Color While Typing

Round All Four Corners
By default the top-left corner is square. Set both radius variables to round all four corners the same:

Square Corners

Match Your Brand

Different Colors in Dark Mode
When the widget is in dark mode it has the dark class, so you can set different values for dark mode:

Why Not Style the Text Area Directly?
The widget draws part of the comment box border itself, around the text area. If you set border-color or border-radius only on the textarea, those lines keep the default style and the border looks mismatched, for example a square line running through a rounded corner. The variables above change both at once.
コメントウィジェット カスタムCSSリファレンス(v2、最新) 

最近のコメントウィジェットのスタイリング 
Recent Comments ウィジェットは、サイト全体または特定のページの最新コメントを一覧表示します。見出し、丸いアバター、コメントプレビュー、コメントへのディープリンクとなるクリック可能な日付、自動的なダークモード検出が含まれます。
Basic Installation
Run 
Configuration Options
- tenantId (required): Your FastComments tenant ID
- urlId (optional): Filter to a single page. Leave null for all pages
- count (optional): Number of comments to show. Default is
10 - hasDarkBackground (optional): Force dark mode styling. Auto-detected from the page background if not set
Widget Structure
The widget renders with the following HTML structure:

Default CSS Reference

Customization Examples
Change Avatar Size

Show More Lines of Comment Text

Remove the Container Border

最も議論されたページウィジェットのスタイリング 
最も議論されたページ ウィジェットは、コメント数の多いページをランク付きリストで表示します。見出し、番号付きランク、アイコン付きのコメント数、最終アクティビティの日付、および自動ダークモード検出が含まれます。
基本的なインストール
Run 
設定オプション
- tenantId (必須): あなたの FastComments テナント ID
- hasDarkBackground (任意): ダークモードのスタイリングを強制します。未設定の場合はページの背景から自動検出されます
ウィジェット構造
ウィジェットは次のHTML構造でレンダリングされます:

デフォルトのCSS参照

カスタマイズ例
ランクバッジを削除

コンテナのボーダーを削除

最近のディスカッションウィジェットのスタイリング 
The Recent Discussions ウィジェットは、最新のコメント活動でソートされたページのリストを表示します。見出し、最終活動日時、アイコン付きのコメント数、そして自動ダークモード検出が含まれます。
基本インストール
Run 
設定オプション
- tenantId (required): あなたの FastComments テナント ID
- count (optional): 表示するページ数。デフォルトは
20、最大100 - hasDarkBackground (optional): ダークモードのスタイリングを強制します。設定されていない場合はページの背景から自動検出されます
ウィジェット構造
ウィジェットは以下の HTML 構造でレンダリングされます:

デフォルト CSS リファレンス

カスタマイズ例
コンテナの境界線を削除する

カスタムリンクカラー
