Skip to content

Commit 365842d

Browse files
yulin0629claude
andcommitted
fix: 修正 modal 關閉按鈕位置問題
- 將關閉按鈕從 fixed 改為 absolute 定位 - 固定在 modal 內容右上角,不會跟著滾動 - 改用深色背景和白色圖示,提升可見性 - 移除不必要的響應式定位規則 - 優化 hover 和 active 狀態效果 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f8ef9bf commit 365842d

1 file changed

Lines changed: 10 additions & 21 deletions

File tree

style.css

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -660,13 +660,13 @@ body {
660660
}
661661

662662
.markdown-close {
663-
position: fixed;
664-
top: 70px;
665-
right: max(calc(50% - 450px + 20px), 20px);
663+
position: absolute;
664+
top: -15px;
665+
right: -15px;
666666
width: 30px;
667667
height: 30px;
668668
cursor: pointer;
669-
background: rgba(142, 142, 147, 0.12);
669+
background: rgba(60, 60, 67, 0.8);
670670
border-radius: 15px;
671671
display: flex;
672672
align-items: center;
@@ -676,6 +676,7 @@ body {
676676
border: none;
677677
outline: none;
678678
padding: 0;
679+
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
679680
}
680681

681682
.markdown-close::before,
@@ -684,7 +685,7 @@ body {
684685
position: absolute;
685686
width: 14px;
686687
height: 1.5px;
687-
background: rgba(60, 60, 67, 0.6);
688+
background: white;
688689
border-radius: 2px;
689690
}
690691

@@ -697,32 +698,20 @@ body {
697698
}
698699

699700
.markdown-close:hover {
700-
background: rgba(142, 142, 147, 0.2);
701+
background: rgba(60, 60, 67, 1);
702+
transform: scale(1.1);
701703
}
702704

703705
.markdown-close:hover::before,
704706
.markdown-close:hover::after {
705-
background: rgba(60, 60, 67, 0.8);
707+
background: white;
706708
}
707709

708710
.markdown-close:active {
709-
background: rgba(142, 142, 147, 0.3);
711+
background: rgba(40, 40, 47, 1);
710712
transform: scale(0.96);
711713
}
712714

713-
@media (max-width: 960px) {
714-
.markdown-close {
715-
right: 20px;
716-
top: 60px;
717-
}
718-
}
719-
720-
@media (max-width: 768px) {
721-
.markdown-close {
722-
right: 15px;
723-
top: 15px;
724-
}
725-
}
726715

727716
/* Markdown 渲染樣式 */
728717
.markdown-content h1 {

0 commit comments

Comments
 (0)