tfrere HF Staff commited on
Commit
c68749f
·
1 Parent(s): 9aec70e

fix: TOC mobile toggle not visible due to CSS cascade order

Browse files

The _toc.css component file (loaded last) set display:none on
.toc-mobile-toggle/backdrop/sidebar by default, overriding the
@media responsive rules in _layout.css (loaded earlier).

Move the responsive display overrides into _toc.css so they appear
after the default rules and win in the cascade when the media query
matches. This fixes the TOC being completely invisible on viewports
< 1100px (including HF Spaces iframe at ~968px).

Made-with: Cursor

frontend/src/styles/_layout.css CHANGED
@@ -39,18 +39,6 @@
39
  display: none;
40
  }
41
 
42
- .toc-mobile-toggle {
43
- display: flex;
44
- }
45
-
46
- .toc-mobile-backdrop {
47
- display: block;
48
- }
49
-
50
- .toc-mobile-sidebar {
51
- display: flex;
52
- }
53
-
54
  .footer-inner {
55
  grid-template-columns: 1fr;
56
  gap: 16px;
 
39
  display: none;
40
  }
41
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  .footer-inner {
43
  grid-template-columns: 1fr;
44
  gap: 16px;
frontend/src/styles/components/_toc.css CHANGED
@@ -221,3 +221,22 @@
221
  color: var(--primary-color);
222
  text-decoration: underline;
223
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  color: var(--primary-color);
222
  text-decoration: underline;
223
  }
224
+
225
+ /* ============================================================================ */
226
+ /* Responsive: show mobile TOC elements on small viewports */
227
+ /* Must be AFTER default display:none rules to win in the cascade */
228
+ /* ============================================================================ */
229
+
230
+ @media (--bp-content-collapse) {
231
+ .toc-mobile-toggle {
232
+ display: flex;
233
+ }
234
+
235
+ .toc-mobile-backdrop {
236
+ display: block;
237
+ }
238
+
239
+ .toc-mobile-sidebar {
240
+ display: flex;
241
+ }
242
+ }