Skip to content

Commit 8c3d827

Browse files
author
y-yamasaki
committed
Merge branch 'develop'
2 parents 6266dca + 3cd968f commit 8c3d827

44 files changed

Lines changed: 2720 additions & 265 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

WebSite/assets/css/blog.css

Lines changed: 227 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,12 @@
320320
.markdown-body h3 {
321321
font-size: 1.5rem;
322322
padding-bottom: 0.4rem;
323-
border-bottom: 2px solid var(--color-border-soft);
324323
}
325324
.markdown-body h3::after {
326325
/* アクセントの下線を追加 */
327326
content: "";
328327
display: block;
329-
width: 60px;
328+
width: auto;
330329
height: 2px;
331330
background: var(--color-accent);
332331
margin-top: 0.4rem;
@@ -339,12 +338,12 @@
339338

340339
/* 段落・リスト */
341340
.markdown-body p {
342-
margin: 1.5rem 0;
341+
margin: 1rem 0;
343342
}
344343
.markdown-body ul,
345344
.markdown-body ol {
346345
padding-left: 1.5rem;
347-
margin: 1.5rem 0;
346+
margin: 0rem 0;
348347
}
349348
.markdown-body ul {
350349
list-style: disc;
@@ -353,7 +352,7 @@
353352
list-style: decimal;
354353
}
355354
.markdown-body li {
356-
margin-bottom: 0.5rem;
355+
margin-bottom: 0.1rem;
357356
padding-left: 0.2rem;
358357
}
359358
.markdown-body li::marker {
@@ -433,7 +432,7 @@
433432

434433
.markdown-body pre {
435434
position: relative;
436-
background: #0d1117; /* GitHub Dark Dimmed 風 */
435+
background: #0d1117;
437436
padding: 1.25rem;
438437
border-radius: var(--radius-md);
439438
overflow-x: auto;
@@ -443,11 +442,230 @@
443442
border: 1px solid var(--color-border);
444443
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
445444
}
446-
.markdown-body pre code {
445+
446+
/* コードブロック上部に表示する言語ラベルと Mermaid 用コンテナ */
447+
.code-block {
448+
position: relative;
449+
margin: 1rem 0;
450+
border-radius: var(--radius-md);
451+
overflow: hidden;
452+
background: inherit;
453+
border: 1px solid var(--color-border);
454+
}
455+
456+
/* 言語ラベル(右上) */
457+
.code-block .code-header {
458+
position: absolute;
459+
top: 8px;
460+
right: 8px;
461+
background: rgba(0, 0, 0, 0.45);
462+
color: #fff;
463+
padding: 0.18rem 0.5rem;
464+
font-size: 12px;
465+
line-height: 1;
466+
border-radius: 4px;
467+
z-index: 2;
468+
backdrop-filter: blur(6px);
469+
-webkit-backdrop-filter: blur(6px);
470+
display: inline-flex;
471+
align-items: center;
472+
}
473+
474+
/* 言語アイコン */
475+
.code-header .lang-icon,
476+
.code-block .lang-icon {
477+
display: inline-flex;
478+
width: 18px;
479+
height: 18px;
480+
margin-right: 0.4rem;
481+
line-height: 1;
482+
vertical-align: middle;
483+
}
484+
485+
/* ラベルテキスト */
486+
.code-header .lang-label {
487+
display: inline-block;
488+
font-weight: 600;
489+
font-size: 12px;
490+
}
491+
492+
/* code-block 内の pre を調整してヘッダー分の余白を確保 */
493+
.code-block pre {
494+
margin: 0;
495+
padding-top: 2.2rem; /* space for header */
447496
background: transparent;
448-
padding: 0;
449-
color: #c9d1d9; /* 標準的なコード色 */
450497
border-radius: 0;
498+
overflow-x: auto;
499+
}
500+
501+
/* 内部の code 要素はブロック表示にしてパディングを調整 */
502+
.code-block pre code {
503+
display: block;
504+
padding: 0.8rem 1rem 1rem 1rem;
505+
background: transparent;
506+
}
507+
508+
/* Mermaid コンテナラッパー(スクロールとドラッグ対応) */
509+
.mermaid-wrapper {
510+
margin: 1.25rem 0;
511+
overflow: hidden;
512+
background: var(--color-panel);
513+
cursor: grab;
514+
/* JS制御のためブラウザ標準の操作を無効化 */
515+
touch-action: none;
516+
-webkit-overflow-scrolling: touch;
517+
/* ページ全体へのオーバースクロール伝播を抑制(UX向上) */
518+
overscroll-behavior: contain;
519+
/* 図の選択を防ぐ(ドラッグ時の余分な選択を抑制) */
520+
user-select: none;
521+
/* 図の領域が分かるように枠・背景・陰影を付与 */
522+
border: 1px solid var(--color-border);
523+
border-radius: var(--radius-md);
524+
padding: 0.75rem;
525+
box-shadow: var(--shadow-md);
526+
position: relative;
527+
}
528+
.mermaid-wrapper:active {
529+
cursor: grabbing;
530+
}
531+
.mermaid-wrapper .mermaid {
532+
display: block;
533+
/* transform を使う場合に備え、変換の起点と最適化を指定 */
534+
transform-origin: 0 0;
535+
will-change: transform;
536+
transition: transform 180ms
537+
cubic-bezier(0.2, 0.8, 0.2, 1);
538+
}
539+
.mermaid-wrapper .mermaid svg {
540+
max-width: none;
541+
width: auto;
542+
display: block;
543+
/* SVG 内のタッチアクションは個別に扱う(ピンチ操作はラッパーで処理) */
544+
touch-action: none;
545+
user-select: none;
546+
}
547+
548+
/* Mermaid toolbar (右上に縦並び) */
549+
.mermaid-toolbar {
550+
position: absolute;
551+
top: 8px;
552+
right: 8px;
553+
display: flex;
554+
flex-direction: column;
555+
gap: 8px;
556+
/* 高いスタッキングで常にコンテンツより前面に表示 */
557+
z-index: 9999;
558+
/* 右端に寄せてボタン群がコンテンツの右上に揃うようにする */
559+
align-items: flex-end;
560+
/* ツールバー自身でポインターイベントを受け取る(親で無効化していたため有効化) */
561+
pointer-events: auto;
562+
/* レイヤーを分離してアニメーション時の描画安定化を助ける */
563+
transform: translateZ(0);
564+
}
565+
.mermaid-toolbar .btn {
566+
pointer-events: auto;
567+
display: inline-flex;
568+
align-items: center;
569+
justify-content: center;
570+
width: 36px;
571+
height: 36px;
572+
border-radius: 8px;
573+
/* 少し濃いめの背景で見やすくする(ダーク/ライト両対応の調整はここで可能) */
574+
background: rgba(0, 0, 0, 0.7);
575+
color: #fff;
576+
border: 1px solid rgba(255, 255, 255, 0.08);
577+
box-shadow: var(--shadow-sm);
578+
cursor: pointer;
579+
transition:
580+
transform 120ms ease,
581+
background 120ms ease;
582+
font-size: 14px;
583+
/* ボタンを前面にしてクリックを確実化 */
584+
position: relative;
585+
z-index: 10000;
586+
}
587+
.mermaid-toolbar .btn:hover {
588+
transform: translateY(-2px);
589+
background: rgba(0, 0, 0, 0.75);
590+
}
591+
.mermaid-toolbar .btn:active {
592+
transform: translateY(0);
593+
}
594+
595+
/* Scale badge */
596+
.mermaid-toolbar .scale-badge {
597+
pointer-events: auto;
598+
display: inline-flex;
599+
align-items: center;
600+
justify-content: center;
601+
min-width: 44px;
602+
height: 28px;
603+
padding: 0 8px;
604+
border-radius: 14px;
605+
background: rgba(0, 0, 0, 0.45);
606+
color: #fff;
607+
font-size: 12px;
608+
font-weight: 600;
609+
}
610+
611+
/* Mermaid 内タイトルの見やすさ改善 */
612+
.mermaid-wrapper .mermaid svg text.title,
613+
.mermaid-wrapper .mermaid svg .title,
614+
.mermaid-wrapper .mermaid svg .label {
615+
fill: var(--color-heading);
616+
font-weight: 700;
617+
font-size: 1.05em;
618+
paint-order: stroke fill;
619+
stroke: rgba(0, 0, 0, 0.02);
620+
stroke-width: 0.4px;
621+
}
622+
623+
/* mermaid SVG 最大高さの制限(縦長すぎるのを防ぐ) */
624+
.mermaid-wrapper {
625+
max-height: 60vh;
626+
overflow: auto;
627+
}
628+
629+
/* SVG 本体にも制限をかけて縦長表示を防ぐ(アスペクトを維持) */
630+
.mermaid-wrapper .mermaid svg {
631+
max-height: 120vh;
632+
height: auto;
633+
max-width: 100%;
634+
display: block;
635+
box-sizing: content-box;
636+
}
637+
638+
/* small responsive tweaks */
639+
@media (max-width: 680px) {
640+
.mermaid-toolbar {
641+
top: 6px;
642+
right: 6px;
643+
gap: 6px;
644+
}
645+
.mermaid-toolbar .btn {
646+
width: 32px;
647+
height: 32px;
648+
border-radius: 6px;
649+
font-size: 13px;
650+
}
651+
.mermaid-toolbar .scale-badge {
652+
min-width: 40px;
653+
height: 24px;
654+
font-size: 11px;
655+
}
656+
}
657+
658+
/* モバイルでヘッダーが重ならないように調整 */
659+
@media (max-width: 680px) {
660+
.code-block .code-header {
661+
top: 6px;
662+
right: 6px;
663+
font-size: 11px;
664+
padding: 0.12rem 0.4rem;
665+
}
666+
.code-block pre {
667+
padding-top: 2rem;
668+
}
451669
}
452670

453671
/* 画像 */

0 commit comments

Comments
 (0)