Skip to content

Commit ce44b84

Browse files
committed
Improve typography, introduce mobile breakpoint
1 parent a3e7c6a commit ce44b84

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/django_devbar/middleware.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,24 @@
1717
STYLE_BLOCK = """<style>
1818
#django-devbar {
1919
position: fixed; %s; z-index: 999999999;
20-
display: flex; align-items: center; gap: 4px;
20+
display: flex; align-items: center; gap: 5px;
2121
font-family: -apple-system, system-ui, sans-serif;
2222
font-size: 11px; font-weight: 500;
2323
padding: 4px 8px; margin: 8px; border-radius: 4px;
24-
backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
25-
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
24+
backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
25+
box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.2);
2626
transition: all 0.2s ease;
2727
cursor: default;
2828
line-height: 1.3;
29-
background: rgba(20, 20, 20, 0.85);
30-
color: #e5e5e5;
29+
background: rgba(20, 20, 20, 0.92);
30+
color: #f5f5f5;
3131
}
3232
#django-devbar.level-warn { border-left: 3px solid #f59e0b; }
3333
#django-devbar.level-crit { border-left: 3px solid #dc2626; }
3434
#django-devbar span { opacity: 0.7; }
3535
#django-devbar strong { opacity: 1; font-weight: 600; }
36+
#django-devbar .duplicate-badge { color: #f59e0b; font-weight: 600; }
37+
@media (max-width: 640px) { #django-devbar { display: none; } }
3638
</style>"""
3739

3840
BAR_TEMPLATE = """<div id="django-devbar" class="level-%s">
@@ -128,7 +130,7 @@ def _inject_devbar(self, response, stats, level):
128130
return
129131

130132
dup_marker = (
131-
' <strong style="color:#f59e0b">(d)</strong>'
133+
' <strong class="duplicate-badge">(d)</strong>'
132134
if stats["has_duplicates"]
133135
else ""
134136
)

0 commit comments

Comments
 (0)