micro-sidebar 1.1.0__tar.gz → 1.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/PKG-INFO +3 -1
  2. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/README.md +3 -1
  3. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/micro_sidebar.egg-info/PKG-INFO +3 -1
  4. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/pyproject.toml +1 -1
  5. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/setup.py +1 -1
  6. micro_sidebar-1.2.1/sidebar/static/sidebar/sidebar.css +206 -0
  7. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/sidebar/static/sidebar/sidebar.js +16 -14
  8. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/sidebar/templates/sidebar/main.html +13 -0
  9. micro_sidebar-1.1.0/sidebar/static/sidebar/sidebar.css +0 -93
  10. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/LICENSE +0 -0
  11. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/MANIFEST.in +0 -0
  12. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/micro_sidebar.egg-info/SOURCES.txt +0 -0
  13. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/micro_sidebar.egg-info/dependency_links.txt +0 -0
  14. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/micro_sidebar.egg-info/requires.txt +0 -0
  15. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/micro_sidebar.egg-info/top_level.txt +0 -0
  16. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/setup.cfg +0 -0
  17. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/sidebar/__init__.py +0 -0
  18. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/sidebar/apps.py +0 -0
  19. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/sidebar/migrations/__init__.py +0 -0
  20. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/sidebar/urls.py +0 -0
  21. {micro_sidebar-1.1.0 → micro_sidebar-1.2.1}/sidebar/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: micro_sidebar
3
- Version: 1.1.0
3
+ Version: 1.2.1
4
4
  Summary: A Reusable RTL Django Sidebar App
5
5
  Home-page: https://github.com/debeski/micro-sidebar
6
6
  Author: DeBeski
@@ -112,3 +112,5 @@ While it may theoretically work in LTR environments if standard Bootstrap files
112
112
  | **v1.0.1** | Fixed titlebar positioning bug causing overlap/gaps. |
113
113
  | **v1.0.2** | Improved documentation clarity and added usage instructions. |
114
114
  | **v1.1.0** | Renamed `content.html` to `main.html` for clarity. Refactored to use `{% block items %}` for easier extension. |
115
+ | **v1.2.0** | **New Theme Implementation:** Redesigned UI with rounded pill-shaped items, tactile micro-animations, and a refined color palette. Improved responsiveness with dynamic top-offset calculations and inline FOUC fixes for small screens. Fixed tooltip stickiness bug. |
116
+ | **v1.2.1** | **Positioning Fix:** Added `align-self: flex-start` to resolve 60px vertical offset in flex containers. Removed legacy `sidebar-top-offset` CSS variable and JS calculations. Added `box-shadow: none` and `outline: none` to accordion buttons to remove focus ring. Fixed page flickering on wider screens by constraining sidebar height with `calc(100vh - header-height)`. |
@@ -85,4 +85,6 @@ While it may theoretically work in LTR environments if standard Bootstrap files
85
85
  | **v1.0.0** | Initial Release. |
86
86
  | **v1.0.1** | Fixed titlebar positioning bug causing overlap/gaps. |
87
87
  | **v1.0.2** | Improved documentation clarity and added usage instructions. |
88
- | **v1.1.0** | Renamed `content.html` to `main.html` for clarity. Refactored to use `{% block items %}` for easier extension. |
88
+ | **v1.1.0** | Renamed `content.html` to `main.html` for clarity. Refactored to use `{% block items %}` for easier extension. |
89
+ | **v1.2.0** | **New Theme Implementation:** Redesigned UI with rounded pill-shaped items, tactile micro-animations, and a refined color palette. Improved responsiveness with dynamic top-offset calculations and inline FOUC fixes for small screens. Fixed tooltip stickiness bug. |
90
+ | **v1.2.1** | **Positioning Fix:** Added `align-self: flex-start` to resolve 60px vertical offset in flex containers. Removed legacy `sidebar-top-offset` CSS variable and JS calculations. Added `box-shadow: none` and `outline: none` to accordion buttons to remove focus ring. Fixed page flickering on wider screens by constraining sidebar height with `calc(100vh - header-height)`. |
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: micro-sidebar
3
- Version: 1.1.0
3
+ Version: 1.2.1
4
4
  Summary: A Reusable RTL Django Sidebar App
5
5
  Home-page: https://github.com/debeski/micro-sidebar
6
6
  Author: DeBeski
@@ -112,3 +112,5 @@ While it may theoretically work in LTR environments if standard Bootstrap files
112
112
  | **v1.0.1** | Fixed titlebar positioning bug causing overlap/gaps. |
113
113
  | **v1.0.2** | Improved documentation clarity and added usage instructions. |
114
114
  | **v1.1.0** | Renamed `content.html` to `main.html` for clarity. Refactored to use `{% block items %}` for easier extension. |
115
+ | **v1.2.0** | **New Theme Implementation:** Redesigned UI with rounded pill-shaped items, tactile micro-animations, and a refined color palette. Improved responsiveness with dynamic top-offset calculations and inline FOUC fixes for small screens. Fixed tooltip stickiness bug. |
116
+ | **v1.2.1** | **Positioning Fix:** Added `align-self: flex-start` to resolve 60px vertical offset in flex containers. Removed legacy `sidebar-top-offset` CSS variable and JS calculations. Added `box-shadow: none` and `outline: none` to accordion buttons to remove focus ring. Fixed page flickering on wider screens by constraining sidebar height with `calc(100vh - header-height)`. |
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "micro_sidebar"
10
- version = "1.1.0"
10
+ version = "1.2.1"
11
11
  description = "A Reusable RTL Django Sidebar App"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.9"
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="micro_sidebar",
5
- version="1.1.0",
5
+ version="1.2.1",
6
6
  author="DeBeski",
7
7
  author_email="debeski1@gmail.com",
8
8
  description="A Reusable RTL Django Sidebar App",
@@ -0,0 +1,206 @@
1
+ .sidebar {
2
+ z-index: 900;
3
+ transition: width 0.2s ease-in-out;
4
+ background: linear-gradient(180deg, #ffffff 10%, #f1f7fd 100%);
5
+ position: sticky;
6
+ top: var(--header-height, 60px);
7
+ align-self: flex-start; /* Force to top of flex container */
8
+ overflow-y: auto;
9
+ overflow-x: hidden;
10
+ height: calc(100vh - var(--header-height, 60px));
11
+ border-left: 1px solid #f1f3f5;
12
+ scrollbar-width: thin;
13
+ scrollbar-color: rgba(0,0,0,0.1) transparent;
14
+
15
+ /* Variables for stable positioning */
16
+ --sidebar-item-px: 12.5px;
17
+ --sidebar-icon-width: 40px;
18
+ }
19
+
20
+ .sidebar::-webkit-scrollbar {
21
+ width: 6px;
22
+ }
23
+ .sidebar::-webkit-scrollbar-track {
24
+ background: transparent;
25
+ }
26
+ .sidebar::-webkit-scrollbar-thumb {
27
+ background-color: rgba(0,0,0,0.2);
28
+ border-radius: 20px;
29
+ }
30
+
31
+ .sidebar.collapsed {
32
+ width: 65px !important;
33
+ }
34
+
35
+ /* Stable layout for icons - NO OVERRIDES for padding/gap here! */
36
+ .sidebar.collapsed .list-group-item span,
37
+ .sidebar.collapsed .accordion-button span {
38
+ opacity: 0;
39
+ visibility: hidden;
40
+ width: 0;
41
+ display: inline-block; /* Keep it in flow but hidden */
42
+ }
43
+
44
+ .sidebar .list-group-item span,
45
+ .sidebar .accordion-button span {
46
+ transition: opacity 0.2s ease, visibility 0.2s;
47
+ white-space: nowrap;
48
+ }
49
+
50
+ .sidebar.collapsed .accordion-button::after {
51
+ display: none !important;
52
+ }
53
+
54
+ .sidebar-ghost {
55
+ display: none;
56
+ width: 52px;
57
+ flex-shrink: 0;
58
+ }
59
+
60
+ @media (max-width: 1100px) {
61
+ .sidebar-ghost {
62
+ display: block;
63
+ }
64
+
65
+ .sidebar {
66
+ position: fixed;
67
+ top: var(--header-height, 60px);
68
+ right: 0;
69
+ width: 250px;
70
+ transition: width 0.15s ease-in-out;
71
+ height: calc(100vh - var(--header-height, 60px));
72
+ z-index: 1000;
73
+ --sidebar-item-px: 6px;
74
+ }
75
+
76
+ .sidebar.collapsed {
77
+ width: 52px !important;
78
+ right: 0;
79
+ position: fixed;
80
+ }
81
+ }
82
+ /* Sidebar Styling Redesign */
83
+ .sidebar .list-group-item {
84
+ border: 1px solid transparent !important; /* Reserve space to prevent jumps */
85
+ font-size: 0.95rem !important;
86
+ font-weight: 600 !important;
87
+ color: #5a6474; /* Softer text color */
88
+ margin: 4px 0;
89
+ border-radius: 12px !important; /* Rounded pill shape */
90
+ transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
91
+ display: flex;
92
+ align-items: center;
93
+ gap: 10px;
94
+ padding: 12px var(--sidebar-item-px);
95
+ white-space: nowrap;
96
+ overflow: hidden;
97
+ }
98
+
99
+ .sidebar .list-group-item:hover {
100
+ background-color: transparent !important;
101
+ color: var(--primal) !important;
102
+ transform: translateX(-4px); /* Tactile slide for RTL */
103
+ }
104
+
105
+ .sidebar .list-group-item.active {
106
+ border: 1px solid transparent !important; /* Keep the 1px reserve */
107
+ background-color: rgba(35, 99, 195, 0.05) !important; /* Lighter soft blue */
108
+ color: var(--primal) !important;
109
+ font-weight: 700 !important;
110
+ box-shadow: 0 4px 12px rgba(35, 99, 195, 0.08) !important;
111
+ }
112
+
113
+ .sidebar .list-group-item i,
114
+ .sidebar .accordion-button i {
115
+ width: var(--sidebar-icon-width);
116
+ display: flex;
117
+ justify-content: center;
118
+ flex-shrink: 0;
119
+ font-size: 1.25rem;
120
+ transition: transform 0.2s ease, color 0.2s;
121
+ color: #8c98a4; /* Muted icon color by default */
122
+ }
123
+
124
+ .sidebar .list-group-item:hover i,
125
+ .sidebar .list-group-item.active i,
126
+ .sidebar .accordion-button:hover i,
127
+ .sidebar .accordion-button:not(.collapsed) i {
128
+ transform: scale(1.1);
129
+ color: var(--primal); /* Active/Hover icon color */
130
+ }
131
+
132
+ .sidebar .accordion-button {
133
+ font-size: 0.95rem !important;
134
+ font-weight: 600 !important;
135
+ color: #5a6474;
136
+ background-color: transparent !important;
137
+ border: 1px solid transparent !important; /* Reserve space here too */
138
+ border-radius: 12px !important;
139
+ margin: 4px 0;
140
+ padding: 12px var(--sidebar-item-px);
141
+ display: flex;
142
+ align-items: center;
143
+ gap: 10px;
144
+ white-space: nowrap;
145
+ overflow: hidden;
146
+ transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
147
+ box-shadow: none !important;
148
+ outline: none !important;
149
+ }
150
+
151
+ .sidebar .accordion-button:focus {
152
+ box-shadow: none !important;
153
+ outline: none !important;
154
+ }
155
+
156
+ .sidebar .accordion-button:not(.collapsed) {
157
+ background-color: rgba(35, 99, 195, 0.04) !important; /* Very subtle open state */
158
+ color: var(--primal) !important;
159
+ font-weight: 700 !important;
160
+ }
161
+
162
+ .sidebar .accordion-button:hover {
163
+ color: var(--primal) !important;
164
+ background-color: transparent !important;
165
+ transform: translateX(-4px);
166
+ }
167
+
168
+ .sidebar .accordion-item {
169
+ background-color: transparent !important;
170
+ border: none !important;
171
+ }
172
+
173
+ .sidebar .accordion-body {
174
+ background-color: transparent !important;
175
+ border: none !important;
176
+ padding-top: 0;
177
+ padding-bottom: 0;
178
+ }
179
+
180
+
181
+ .sidebar-toggle {
182
+ background-color: transparent;
183
+ color: #2c3e50;
184
+ border: none;
185
+ transition: background-color 0.3s, transform 0.1s;
186
+ min-width: 5vh;
187
+ min-height: 5vh;
188
+ font-size: 1.5rem;
189
+ }
190
+
191
+ .sidebar-toggle:hover {
192
+ background-color: #f8f9fa;
193
+ color: #0d6efd;
194
+ }
195
+
196
+ .sidebar-toggle:active {
197
+ transform: scale(0.95);
198
+ }
199
+
200
+ .tooltip-custom .tooltip-inner {
201
+ font-size: 1.2rem;
202
+ background-color: var(--title);
203
+ color: white;
204
+ padding: 8px 12px;
205
+ border-radius: 5px;
206
+ }
@@ -21,24 +21,11 @@ document.addEventListener("DOMContentLoaded", function () {
21
21
  // Function to handle sidebar collapsing based on window size
22
22
  function adjustSidebarForWindowSize() {
23
23
  const screenWidth = window.innerWidth;
24
- const titlebar = document.querySelector('.titlebar');
25
- const titlebarHeight = titlebar ? titlebar.offsetHeight : 0;
26
24
 
27
25
  if (screenWidth < 1100) {
28
26
  // Always collapse sidebar on small screens
29
27
  sidebar.classList.add("collapsed");
30
28
  initializeTooltips();
31
-
32
- // Dynamic positioning to anchor to titlebar
33
- // Dynamic positioning to anchor to titlebar
34
- if (titlebarHeight > 0) {
35
- sidebar.style.top = titlebarHeight + 'px';
36
- sidebar.style.height = (window.innerHeight - titlebarHeight) + 'px';
37
- } else {
38
- // Failsafe: Stick to top if no titlebar
39
- sidebar.style.top = '0px';
40
- sidebar.style.height = '100vh';
41
- }
42
29
  } else {
43
30
  // Reset styles for large screens to let CSS take over (sticky)
44
31
  sidebar.style.top = '';
@@ -99,6 +86,20 @@ document.addEventListener("DOMContentLoaded", function () {
99
86
  setTimeout(triggerAutoscale, 250);
100
87
  });
101
88
  }
89
+
90
+ // Proactively hide tooltips when any sidebar click occurs
91
+ // This fixes the "sticking to top of screen" glitch during transitions
92
+ sidebar.addEventListener("click", function (event) {
93
+ // Find all tooltips in the sidebar and dispose them immediately
94
+ // This ensures they are completely removed from the DOM before any transition
95
+ const sidebarItems = sidebar.querySelectorAll(".list-group-item, .accordion-button");
96
+ sidebarItems.forEach(item => {
97
+ if (item._tooltip) {
98
+ item._tooltip.dispose();
99
+ delete item._tooltip;
100
+ }
101
+ });
102
+ });
102
103
  });
103
104
 
104
105
  // Close sidebar when clicking outside (only for small screens)
@@ -138,7 +139,8 @@ function initializeTooltips() {
138
139
  item._tooltip = new bootstrap.Tooltip(item, {
139
140
  title: item.querySelector("span").textContent,
140
141
  placement: "right",
141
- customClass: "tooltip-custom"
142
+ customClass: "tooltip-custom",
143
+ trigger: 'hover' // Explicitly disable click/focus triggers
142
144
  });
143
145
  });
144
146
  }
@@ -9,6 +9,19 @@
9
9
  id="sidebar"
10
10
  data-toggle-url="{% url 'toggle_sidebar' %}"
11
11
  data-session-collapsed="{{ request.session.sidebarCollapsed|yesno:'true,false' }}">
12
+ <script>
13
+ // Immediate FOUC fix for small screens
14
+ (function() {
15
+ var screenWidth = window.innerWidth;
16
+ var sidebar = document.currentScript.parentElement;
17
+ if (screenWidth < 1100) {
18
+ sidebar.classList.add('collapsed');
19
+ // Temporarily disable transition to avoid "sliding shut" flicker on load
20
+ sidebar.style.transition = 'none';
21
+ setTimeout(function() { sidebar.style.transition = ''; }, 100);
22
+ }
23
+ })();
24
+ </script>
12
25
  <div class="list-group flex-shrink-0">
13
26
  {% block items %}
14
27
 
@@ -1,93 +0,0 @@
1
-
2
- .sidebar {
3
- z-index: 900;
4
- transition: width 0.15s ease-in-out;
5
- background-color: white;
6
- position: -webkit-sticky; /* For Safari */
7
- position: sticky;
8
- top: 0; /* Sticks the sidebar at the top of the parent container */
9
- overflow-y: auto;
10
- overflow-x: hidden;
11
- height: calc(100vh - 45px); /* Fallback/Base height for sticky behavior */
12
- /* Custom Scrollbar for Webkit */
13
- scrollbar-width: thin;
14
- scrollbar-color: rgba(0,0,0,0.2) transparent;
15
- }
16
-
17
- .sidebar::-webkit-scrollbar {
18
- width: 6px;
19
- }
20
- .sidebar::-webkit-scrollbar-track {
21
- background: transparent;
22
- }
23
- .sidebar::-webkit-scrollbar-thumb {
24
- background-color: rgba(0,0,0,0.2);
25
- border-radius: 20px;
26
- }
27
-
28
- .sidebar.collapsed {
29
- width: 52px !important;
30
- }
31
- .sidebar.collapsed .list-group-item span {
32
- display: none !important;
33
- }
34
- .sidebar.collapsed .accordion-button span {
35
- display: none !important;
36
- }
37
- .sidebar.collapsed .accordion-button::after {
38
- background-image: none;
39
- }
40
-
41
-
42
- .sidebar-ghost {
43
- display: none;
44
- width: 52px;
45
- flex-shrink: 0;
46
- }
47
-
48
- @media (max-width: 1100px) {
49
- .sidebar-ghost {
50
- display: block;
51
- }
52
-
53
- .sidebar {
54
- position: fixed;
55
- top: 45px; /* Fallback, JS calculates exact height */
56
- right: 0;
57
- width: 250px;
58
- transition: width 0.15s ease-in-out;
59
- height: calc(100vh - 45px); /* Fallback */
60
- z-index: 1000;
61
- }
62
-
63
- .sidebar.collapsed {
64
- width: 52px !important;
65
- right: 0;
66
- position: fixed;
67
- }
68
- }
69
- .sidebar .list-group-item {
70
- border: none !important;
71
- font-size: 18px !important;
72
- font-weight: 600 !important;
73
- height: 60px !important;
74
- white-space: nowrap;
75
- overflow: hidden;
76
- padding: 12px;
77
- align-items: center;
78
- }
79
-
80
- .sidebar .accordion-button {
81
- font-size: 18px !important;
82
- font-weight: 600 !important;
83
- border: none !important;
84
- height: 60px !important;
85
- white-space: nowrap;
86
- overflow: hidden;
87
- padding: 12px;
88
- align-items: center;
89
- }
90
-
91
- .sidebar .accordion-button:not(.collapsed) {
92
- background-color: var(--body) !important;
93
- }
File without changes
File without changes
File without changes