Skip to content

Commit c7d2c61

Browse files
committed
Day 8: Jazzmin CSS Fix And Gitignore static files
1 parent d9cdadb commit c7d2c61

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ migrations/
2323

2424
# pytest cache
2525
.pytest_cache/
26-
.coverage
26+
.coverage
27+
28+
# Static files
29+
staticfiles/

backend/settings.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,20 @@
179179
}
180180

181181

182+
STATIC_URL = "static/"
183+
STATIC_ROOT = BASE_DIR / "staticfiles"
184+
185+
STATICFILES_DIRS = [
186+
BASE_DIR / "static",
187+
]
188+
189+
182190
JAZZMIN_SETTINGS = {
183191
"site_title": "RO Purifier Admin",
184192
"site_header": "RO Purifier Admin",
185193
"site_brand": "RO Purifier Admin",
186194
"site_icon": "images/favicon.png",
195+
"custom_css": "css/jazzmin-fix.css",
187196
# Add your own branding here
188197
"site_logo": None,
189198
"welcome_sign": "Welcome to the RO Purifier Admin Panel",
@@ -246,7 +255,7 @@
246255

247256

248257
JAZZMIN_UI_TWEAKS = {
249-
"theme": "cyborg",
258+
"theme": "default",
250259
"navbar_small_text": False,
251260
"footer_small_text": False,
252261
"body_small_text": False,

static/css/jazzmin-fix.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/* Reduce global font size */
2+
body,
3+
html {
4+
font-size: 13px !important; /* default is ~16px */
5+
}
6+
7+
/* Sidebar menu font */
8+
.sidebar .nav-link {
9+
font-size: 13px !important;
10+
}
11+
12+
/* Table font size */
13+
table {
14+
font-size: 13px !important;
15+
}
16+
17+
/* Form labels */
18+
.control-label,
19+
.col-form-label {
20+
font-size: 13px !important;
21+
}
22+
23+
/* Inputs and selects */
24+
.form-control,
25+
.select2-selection__rendered {
26+
font-size: 13px !important;
27+
}
28+
29+
30+
/* Make the multi-select option box horizontally scrollable */
31+
.filtered {
32+
white-space: nowrap; /* Prevent text from wrapping */
33+
overflow-x: auto; /* Enable horizontal scroll */
34+
display: block; /* Ensure the container allows scrolling */
35+
max-width: 100%; /* Stay within the screen width */
36+
}
37+
38+
/* Optional: make the select box taller for easier viewing */
39+
.filtered option {
40+
white-space: nowrap; /* Keep each option in a single line */
41+
padding-right: 10px; /* Add spacing so text doesn't stick to the edge */
42+
}

0 commit comments

Comments
 (0)