Skip to content

Commit 1b4a179

Browse files
authored
Fix style (#49)
* fix: 为 content script 样式添加 !important 防止被网站样式覆盖 - 为 public/content-script.css 所有样式属性添加 !important - 删除重复的 styles/content-script.css 文件 - 确保扩展样式不会被网站样式影响 * chore: 更新版本号到 4.0.4
1 parent 16ead08 commit 1b4a179

4 files changed

Lines changed: 129 additions & 361 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "review-bookmark",
3-
"version": "4.0.3",
3+
"version": "4.0.4",
44
"description": "A bookmark manager for Chrome.",
55
"author": "ETY001 <work@akawa.ink>",
66
"license": "MIT",

public/content-script.css

Lines changed: 127 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
/* Content Script 专用样式 - 使用 rb- 前缀避免与页面样式冲突 */
2+
/* 所有样式都使用 !important 确保不被网站样式覆盖 */
3+
24
/* 容器默认隐藏 */
35
#review-bookmark {
4-
display: none;
6+
display: none !important;
57
}
68

79
#review-bookmark-notification {
8-
display: none;
10+
display: none !important;
911
}
1012

1113
#review-bookmark-dialog {
12-
display: none;
14+
display: none !important;
1315
}
1416

1517
/* 显示状态类 */
@@ -19,216 +21,228 @@
1921

2022
/* 对话框遮罩层 */
2123
.rb-dialog-overlay {
22-
position: fixed;
23-
top: 0;
24-
left: 0;
25-
right: 0;
26-
bottom: 0;
27-
background-color: rgba(0, 0, 0, 0.5);
28-
z-index: 999999998;
29-
display: flex;
30-
align-items: center;
31-
justify-content: center;
24+
position: fixed !important;
25+
top: 0 !important;
26+
left: 0 !important;
27+
right: 0 !important;
28+
bottom: 0 !important;
29+
background-color: rgba(0, 0, 0, 0.5) !important;
30+
z-index: 999999998 !important;
31+
display: flex !important;
32+
align-items: center !important;
33+
justify-content: center !important;
3234
}
3335

3436
/* 对话框容器 */
3537
.rb-dialog-container {
36-
background-color: #fff;
37-
border-radius: 8px;
38-
padding: 24px;
39-
max-width: 512px;
40-
width: calc(100% - 32px);
41-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
38+
background-color: #fff !important;
39+
border-radius: 8px !important;
40+
padding: 24px !important;
41+
max-width: 512px !important;
42+
width: calc(100% - 32px) !important;
43+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
4244
}
4345

4446
/* 对话框标题 */
4547
.rb-dialog-title {
46-
font-size: 18px;
47-
font-weight: 600;
48-
margin-bottom: 8px;
49-
color: #444;
48+
font-size: 18px !important;
49+
font-weight: 600 !important;
50+
margin-bottom: 8px !important;
51+
color: #444 !important;
5052
}
5153

5254
/* 对话框描述 */
5355
.rb-dialog-description {
54-
font-size: 14px;
55-
color: #666;
56-
margin-bottom: 16px;
56+
font-size: 14px !important;
57+
color: #666 !important;
58+
margin-bottom: 16px !important;
5759
}
5860

5961
/* 对话框按钮容器 */
6062
.rb-dialog-buttons {
61-
display: flex;
62-
justify-content: flex-end;
63-
gap: 8px;
63+
display: flex !important;
64+
justify-content: flex-end !important;
65+
gap: 8px !important;
6466
}
6567

6668
/* 对话框按钮 */
6769
.rb-dialog-button {
68-
padding: 8px 16px;
69-
font-size: 14px;
70-
font-weight: 500;
71-
border-radius: 4px;
72-
border: none;
73-
cursor: pointer;
74-
transition: background-color 0.2s;
70+
padding: 8px 16px !important;
71+
font-size: 14px !important;
72+
font-weight: 500 !important;
73+
border-radius: 4px !important;
74+
border: none !important;
75+
cursor: pointer !important;
76+
transition: background-color 0.2s !important;
77+
background-color: transparent !important;
78+
color: inherit !important;
7579
}
7680

7781
.rb-dialog-button-cancel {
78-
background-color: #fff;
79-
color: #444;
80-
border: 1px solid #ccc;
82+
background-color: #fff !important;
83+
color: #444 !important;
84+
border: 1px solid #ccc !important;
8185
}
8286

8387
.rb-dialog-button-cancel:hover {
84-
background-color: #f3f4f6;
88+
background-color: #f3f4f6 !important;
8589
}
8690

8791
.rb-dialog-button-confirm {
88-
background-color: #53a8ff;
89-
color: #fff;
92+
background-color: #53a8ff !important;
93+
color: #fff !important;
9094
}
9195

9296
.rb-dialog-button-confirm:hover {
93-
background-color: #4285d6;
97+
background-color: #4285d6 !important;
9498
}
9599

96100
/* 通知容器 */
97101
.rb-notification {
98-
position: fixed;
99-
z-index: 999999999;
100-
background-color: #fff;
101-
border: 2px solid #53a8ff;
102-
border-radius: 12px;
103-
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
104-
padding: 20px;
105-
min-width: 320px;
106-
max-width: 420px;
107-
pointer-events: auto;
108-
color: #444;
109-
font-family: system-ui, -apple-system, sans-serif;
102+
position: fixed !important;
103+
z-index: 999999999 !important;
104+
background-color: #fff !important;
105+
border: 2px solid #53a8ff !important;
106+
border-radius: 12px !important;
107+
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
108+
padding: 20px !important;
109+
min-width: 320px !important;
110+
max-width: 420px !important;
111+
pointer-events: auto !important;
112+
color: #444 !important;
113+
font-family: system-ui, -apple-system, sans-serif !important;
110114
}
111115

112116
.rb-notification-top-right {
113-
top: 16px;
114-
right: 16px;
117+
top: 16px !important;
118+
right: 16px !important;
115119
}
116120

117121
.rb-notification-top-left {
118-
top: 16px;
119-
left: 16px;
122+
top: 16px !important;
123+
left: 16px !important;
120124
}
121125

122126
.rb-notification-bottom-right {
123-
bottom: 16px;
124-
right: 16px;
127+
bottom: 16px !important;
128+
right: 16px !important;
125129
}
126130

127131
.rb-notification-bottom-left {
128-
bottom: 16px;
129-
left: 16px;
132+
bottom: 16px !important;
133+
left: 16px !important;
130134
}
131135

132136
/* 通知内容区域 */
133137
.rb-notification-content {
134-
margin-bottom: 12px;
138+
margin-bottom: 12px !important;
135139
}
136140

137141
.rb-notification-title {
138-
font-weight: 700;
139-
font-size: 16px;
140-
margin-bottom: 10px;
141-
color: #1f2937;
142-
line-height: 1.4;
142+
font-weight: 700 !important;
143+
font-size: 16px !important;
144+
margin-bottom: 10px !important;
145+
color: #1f2937 !important;
146+
line-height: 1.4 !important;
143147
}
144148

145149
.rb-notification-url {
146-
font-size: 12px;
147-
color: #666;
148-
line-height: 14px;
149-
word-break: break-all;
150+
font-size: 12px !important;
151+
color: #666 !important;
152+
line-height: 14px !important;
153+
word-break: break-all !important;
150154
}
151155

152156
.rb-notification-url-link {
153-
color: #2563eb;
154-
text-decoration: none;
157+
color: #2563eb !important;
158+
text-decoration: none !important;
155159
}
156160

157161
.rb-notification-url-link:hover {
158-
text-decoration: underline;
162+
text-decoration: underline !important;
159163
}
160164

161165
/* 通知按钮容器 */
162166
.rb-notification-buttons {
163-
display: flex;
164-
gap: 8px;
167+
display: flex !important;
168+
gap: 8px !important;
165169
}
166170

167171
/* 通知按钮 */
168172
.rb-notification-button {
169-
width: 36px;
170-
height: 36px;
171-
border-radius: 50%;
172-
border: none; /* 移除边框,使用背景色 */
173-
color: #fff; /* 图标颜色为白色 */
174-
cursor: pointer;
175-
display: flex;
176-
align-items: center;
177-
justify-content: center;
178-
transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out; /* 添加 transform 过渡 */
179-
padding: 0;
180-
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* 按钮阴影 */
173+
width: 36px !important;
174+
height: 36px !important;
175+
border-radius: 50% !important;
176+
border: none !important;
177+
color: #fff !important;
178+
cursor: pointer !important;
179+
display: flex !important;
180+
align-items: center !important;
181+
justify-content: center !important;
182+
transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out !important;
183+
padding: 0 !important;
184+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
185+
background-color: transparent !important;
186+
font-size: inherit !important;
187+
font-weight: inherit !important;
188+
text-align: center !important;
189+
-webkit-appearance: none !important;
190+
appearance: none !important;
181191
}
182192

183193
.rb-notification-button:hover {
184-
transform: scale(1.05); /* hover 放大效果 */
194+
transform: scale(1.05) !important;
185195
}
186196

187197
.rb-notification-button-icon {
188-
width: 18px; /* 增大图标尺寸 */
189-
height: 18px; /* 增大图标尺寸 */
190-
color: #fff; /* 图标颜色为白色 */
198+
width: 18px !important;
199+
height: 18px !important;
200+
color: #fff !important;
191201
}
192202

193203
.rb-notification-button-close {
194-
background-color: #fbbf24; /* 橙色 */
204+
background-color: #fbbf24 !important;
195205
}
206+
196207
.rb-notification-button-close:hover {
197-
background-color: #f59e0b;
208+
background-color: #f59e0b !important;
198209
}
199210

200211
.rb-notification-button-block {
201-
background-color: #3b82f6; /* 蓝色 */
212+
background-color: #3b82f6 !important;
202213
}
214+
203215
.rb-notification-button-block:hover {
204-
background-color: #2563eb;
216+
background-color: #2563eb !important;
205217
}
206218

207219
.rb-notification-button-edit {
208-
background-color: #10b981; /* 绿色 */
220+
background-color: #10b981 !important;
209221
}
222+
210223
.rb-notification-button-edit:hover {
211-
background-color: #059669;
224+
background-color: #059669 !important;
212225
}
213226

214227
.rb-notification-button-remove {
215-
background-color: #ef4444; /* 红色 */
228+
background-color: #ef4444 !important;
216229
}
230+
217231
.rb-notification-button-remove:hover {
218-
background-color: #dc2626;
232+
background-color: #dc2626 !important;
219233
}
220234

221235
/* 倒计时显示 */
222236
.rb-notification-countdown {
223-
position: absolute;
224-
bottom: 8px;
225-
right: 8px;
226-
font-size: 11px;
227-
color: #9ca3af;
228-
font-weight: 500;
229-
background-color: rgba(0, 0, 0, 0.05);
230-
padding: 2px 6px;
231-
border-radius: 4px;
232-
white-space: nowrap;
233-
text-align: center;
237+
position: absolute !important;
238+
bottom: 8px !important;
239+
right: 8px !important;
240+
font-size: 11px !important;
241+
color: #9ca3af !important;
242+
font-weight: 500 !important;
243+
background-color: rgba(0, 0, 0, 0.05) !important;
244+
padding: 2px 6px !important;
245+
border-radius: 4px !important;
246+
white-space: nowrap !important;
247+
text-align: center !important;
234248
}

0 commit comments

Comments
 (0)