|
928 | 928 | .section--related { |
929 | 929 | margin-top: 4rem; |
930 | 930 | } |
| 931 | + |
| 932 | +/* ========================================================================== |
| 933 | + Giscus layout tweaks |
| 934 | + ========================================================================== */ |
| 935 | +/* コンテナ(コメント領域全体) */ |
| 936 | +.post-comments { |
| 937 | + max-width: 900px; /* コンテンツ幅を制限して中央寄せ */ |
| 938 | + margin: 2rem auto; /* 上下の余白 */ |
| 939 | + padding: 0.75rem; /* 内側余白(iframe 周囲)*/ |
| 940 | + box-sizing: border-box; |
| 941 | + border-radius: 12px; |
| 942 | + background: var(--card-bg, #fff); |
| 943 | + box-shadow: 0 6px 18px rgba(20, 30, 40, 0.06); |
| 944 | + overflow: hidden; |
| 945 | +} |
| 946 | + |
| 947 | +/* giscus が生成するラッパー要素(外側) */ |
| 948 | +.post-comments .giscus { |
| 949 | + display: block; |
| 950 | + width: 100%; |
| 951 | + box-sizing: border-box; |
| 952 | +} |
| 953 | + |
| 954 | +/* iframe 要素本体のスタイル(giscus が作る iframe に .giscus-frame が付く) */ |
| 955 | +.post-comments .giscus-frame { |
| 956 | + width: 100%; |
| 957 | + min-height: 240px; /* 必要に応じて調整 */ |
| 958 | + height: auto; /* giscus は自動リサイズするはず */ |
| 959 | + border: 0; |
| 960 | + background: transparent; |
| 961 | + border-radius: 8px; |
| 962 | + /* 見た目の微調整 */ |
| 963 | + box-shadow: none; |
| 964 | +} |
| 965 | + |
| 966 | +/* 小さい画面での調整 */ |
| 967 | +@media (max-width: 640px) { |
| 968 | + .post-comments { |
| 969 | + margin: 1.25rem 1rem; |
| 970 | + padding: 0.6rem; |
| 971 | + border-radius: 8px; |
| 972 | + } |
| 973 | +} |
| 974 | + |
| 975 | +/* ダークモードの微調整(親ドキュメント側の背景を整える) */ |
| 976 | +@media (prefers-color-scheme: dark) { |
| 977 | + .post-comments { |
| 978 | + background: #0b0b0d; |
| 979 | + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45); |
| 980 | + } |
| 981 | + /* iframe 内の色は変更できないので透明背景で馴染ませる */ |
| 982 | + .post-comments .giscus-frame { |
| 983 | + background: transparent; |
| 984 | + } |
| 985 | +} |
| 986 | + |
| 987 | +/* (オプション)外側に小さな見出しを付けたい場合 */ |
| 988 | +.post-comments .comments-header { |
| 989 | + font-size: 0.95rem; |
| 990 | + margin-bottom: 0.5rem; |
| 991 | + color: var(--muted-text, #666); |
| 992 | + padding-left: 0.25rem; |
| 993 | +} |
0 commit comments