From 25982b1541a60328ff7cf912bc0cd76bbc267c05 Mon Sep 17 00:00:00 2001 From: wood chen Date: Fri, 20 Jun 2025 21:04:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=20CSS=20?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E4=BB=A5=E6=8F=90=E9=AB=98=E5=8F=AF=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E6=80=A7=EF=BC=8C=E5=A2=9E=E5=BC=BA=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=92=8C=E9=80=9A=E7=9F=A5=E7=9A=84=E5=8F=AF=E8=A7=81=E6=80=A7?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=BF=87=E6=B8=A1=E6=95=88=E6=9E=9C?= =?UTF-8?q?=EF=BC=8C=E7=A1=AE=E4=BF=9D=E5=9C=A8=E4=B8=8D=E5=90=8C=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E4=B8=8B=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- styles.css | 158 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 121 insertions(+), 37 deletions(-) diff --git a/styles.css b/styles.css index e875641..3eb927a 100644 --- a/styles.css +++ b/styles.css @@ -12,10 +12,11 @@ If your plugin does not need CSS, delete this file. max-width: 500px; max-height: 90vh; background-color: var(--background-primary); - border-radius: 8px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); + border-radius: var(--radius-l); + box-shadow: var(--shadow-xl); display: flex; flex-direction: column; + border: 1px solid var(--background-modifier-border); } /* Content Area Style */ @@ -69,53 +70,80 @@ If your plugin does not need CSS, delete this file. width: 100%; padding: 8px 12px; border: 2px solid var(--background-modifier-border); - border-radius: 4px; + border-radius: var(--radius-s); background-color: var(--background-primary); color: var(--text-normal); font-size: 14px; min-height: 42px; + transition: border-color 0.2s ease, box-shadow 0.2s ease; } .discourse-sync-modal select { height: 42px; line-height: 1.5; + cursor: pointer; +} + +.discourse-sync-modal select:hover { + border-color: var(--background-modifier-border-hover); } .discourse-sync-modal select:focus { - border-color: var(--interactive-accent); + border-color: var(--interactive-accent) !important; outline: none; + box-shadow: 0 0 0 2px var(--interactive-accent-hover); } .discourse-sync-modal .submit-button { width: 100%; padding: 10px 16px; - background-color: var(--interactive-accent); - color: var(--text-on-accent); - border: none; - border-radius: 4px; + border-radius: var(--radius-m); cursor: pointer; font-weight: 500; font-size: 14px; - transition: background-color 0.2s ease; + transition: all 0.2s ease; + /* 确保按钮有合适的尺寸和阴影 */ + min-height: 42px; + box-shadow: var(--shadow-s); +} + +/* 确保按钮在所有主题下都可见 */ +.discourse-sync-modal .submit-button { + /* 强制设置具体的样式值,避免被主题覆盖 */ + background-color: var(--interactive-accent) !important; + color: var(--text-on-accent) !important; + border: 1px solid var(--interactive-accent) !important; + /* 确保按钮有足够的对比度 */ + filter: contrast(1.1) saturate(1.1); } .discourse-sync-modal .submit-button:hover { - background-color: var(--interactive-accent-hover); + background-color: var(--interactive-accent-hover) !important; + border-color: var(--interactive-accent-hover) !important; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important; } .discourse-sync-modal .submit-button:disabled { - opacity: 0.7; - cursor: not-allowed; + background-color: var(--background-modifier-border) !important; + color: var(--text-muted) !important; + border-color: var(--background-modifier-border) !important; + opacity: 1 !important; + filter: none; + cursor: not-allowed !important; } +/* 这些规则已经被上面的 !important 规则覆盖了,移除重复 */ + /* Notice Style */ .discourse-sync-modal .notice { margin-top: 16px; padding: 16px; - border-radius: 8px; + border-radius: var(--radius-m); text-align: left; font-size: 14px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + box-shadow: var(--shadow-s); + border: 1px solid var(--background-modifier-border); + transition: all 0.3s ease; } .discourse-sync-modal .notice.success { @@ -126,16 +154,20 @@ If your plugin does not need CSS, delete this file. } .discourse-sync-modal .notice.error { - background: rgb(255, 235, 235); - border: 1px solid rgba(255, 82, 82, 0.2); - color: rgb(255, 82, 82); + /* 基础样式,会被 !important 规则覆盖 */ +} + +/* 确保错误通知在所有主题下都可见 */ +.discourse-sync-modal .notice.error { + background: var(--background-modifier-error) !important; + border: 1px solid var(--background-modifier-error-border) !important; + color: var(--text-error) !important; } .discourse-sync-modal .error-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; - color: rgb(255, 82, 82); display: flex; align-items: center; gap: 6px; @@ -147,28 +179,40 @@ If your plugin does not need CSS, delete this file. } .discourse-sync-modal .error-message { - color: rgb(255, 82, 82); - opacity: 0.8; font-size: 13px; line-height: 1.5; } +/* 确保错误标题和消息在所有主题下都可见 */ +.discourse-sync-modal .error-title { + color: var(--text-error) !important; +} + +.discourse-sync-modal .error-message { + color: var(--text-error) !important; + opacity: 0.9 !important; +} + .discourse-sync-modal .retry-button { margin-top: 12px; padding: 6px 16px; background-color: transparent; - color: rgb(255, 82, 82); - border: 1px solid rgb(255, 82, 82); - border-radius: 4px; + border-radius: var(--radius-s); cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s ease; } +/* 确保重试按钮在所有主题下都可见 */ +.discourse-sync-modal .retry-button { + color: var(--text-error) !important; + border-color: var(--text-error) !important; +} + .discourse-sync-modal .retry-button:hover { - background-color: rgb(255, 82, 82); - color: white; + background-color: var(--text-error) !important; + color: var(--text-on-accent) !important; } /* Tag Select Area Style */ @@ -199,9 +243,16 @@ If your plugin does not need CSS, delete this file. padding: 4px 8px; background-color: var(--interactive-accent); color: var(--text-on-accent); - border-radius: 4px; + border-radius: var(--radius-s); font-size: 12px; font-weight: 500; + transition: all 0.2s ease; + border: 1px solid var(--interactive-accent); +} + +.discourse-sync-modal .tag:hover { + background-color: var(--interactive-accent-hover); + border-color: var(--interactive-accent-hover); } .discourse-sync-modal .remove-tag { @@ -213,12 +264,17 @@ If your plugin does not need CSS, delete this file. align-items: center; justify-content: center; border-radius: 50%; - background-color: rgba(255, 255, 255, 0.2); + background-color: var(--background-modifier-hover); margin-left: 4px; + transition: all 0.2s ease; + opacity: 0.7; } .discourse-sync-modal .remove-tag:hover { - background-color: rgba(255, 255, 255, 0.3); + background-color: var(--background-modifier-error); + color: var(--text-on-accent); + opacity: 1; + transform: scale(1.1); } .discourse-sync-modal input[type="text"] { @@ -229,6 +285,17 @@ If your plugin does not need CSS, delete this file. color: var(--text-normal); font-size: 14px; outline: none; + transition: background-color 0.2s ease; +} + +.discourse-sync-modal input[type="text"]:focus { + background-color: var(--background-modifier-hover); + border-radius: var(--radius-s); +} + +.discourse-sync-modal input[type="text"]::placeholder { + color: var(--text-muted); + opacity: 0.8; } .discourse-sync-modal .suggestions-container { @@ -248,13 +315,14 @@ If your plugin does not need CSS, delete this file. position: fixed; background-color: var(--background-primary); border: 1px solid var(--background-modifier-border); - border-radius: 4px; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + border-radius: var(--radius-m); + box-shadow: var(--shadow-l); z-index: 1001; max-height: 180px; overflow-y: auto; margin-top: 4px; display: none; /* Hidden by default */ + backdrop-filter: blur(8px); } .discourse-sync-modal .tag-suggestions:not(:empty) { @@ -273,28 +341,40 @@ If your plugin does not need CSS, delete this file. overflow: hidden; text-overflow: ellipsis; background-color: var(--background-primary); + transition: all 0.2s ease; + border-radius: var(--radius-s); + margin: 2px 4px; } .discourse-sync-modal .tag-suggestion:hover { background-color: var(--background-modifier-hover); + color: var(--text-accent); + transform: translateX(2px); +} + +.discourse-sync-modal .tag-suggestion:active { + background-color: var(--interactive-accent); + color: var(--text-on-accent); } /* Tag Suggestion Scrollbar Style */ .discourse-sync-modal .tag-suggestions::-webkit-scrollbar { - width: 4px; + width: 6px; } .discourse-sync-modal .tag-suggestions::-webkit-scrollbar-track { - background: transparent; + background: var(--background-secondary); + border-radius: var(--radius-s); } .discourse-sync-modal .tag-suggestions::-webkit-scrollbar-thumb { background-color: var(--background-modifier-border); - border-radius: 2px; + border-radius: var(--radius-s); + transition: background-color 0.2s ease; } .discourse-sync-modal .tag-suggestions::-webkit-scrollbar-thumb:hover { - background-color: var(--background-modifier-border-hover); + background-color: var(--interactive-accent); } /* Remove tag-container z-index to avoid interference */ @@ -308,9 +388,6 @@ If your plugin does not need CSS, delete this file. left: 50%; transform: translate(-50%, -50%); padding: 12px 20px; - background-color: rgb(255, 235, 235); - border: 1px solid rgba(255, 82, 82, 0.2); - color: rgb(255, 82, 82); border-radius: 4px; font-size: 13px; text-align: center; @@ -322,6 +399,13 @@ If your plugin does not need CSS, delete this file. animation: fadeInOut 2s ease-in-out forwards; } +/* 确保标签通知在所有主题下都可见 */ +.discourse-sync-modal .tag-notice { + background-color: var(--background-modifier-error) !important; + border: 1px solid var(--background-modifier-error-border) !important; + color: var(--text-error) !important; +} + @keyframes fadeInOut { 0% { opacity: 0;