Parcourir la source

fix: hide sidebars on mobile, default print styles in finish_render

Closes #329: add @media(max-width: 45rem) rule to hide #leftbar and
#rightbar on narrow screens. Content area expands to fill the space
since the table-cell layout reflows automatically.

Closes #308: finish_render() now defaults print_styles to
[structure.css, print.css] so any future route calling it directly
gets sane print output without needing to pass print_styles explicitly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Kōan il y a 4 mois
Parent
commit
23eff187f5
2 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 1 0
      lib/Trog/Routes/HTML.pm
  2. 3 0
      www/styles/structure.css

+ 1 - 0
lib/Trog/Routes/HTML.pm

@@ -1683,6 +1683,7 @@ sub finish_render ( $template, $vars, %headers ) {
     $vars->{lang}        //= 'en-US';
     $vars->{title}       //= 'tCMS';
     $vars->{stylesheets} //= [];
+    $vars->{print_styles} //= [qw{structure.css print.css}];
     $vars->{scripts}     //= [];
 
     # Theme-ize the paths

+ 3 - 0
www/styles/structure.css

@@ -137,4 +137,7 @@ iframe.responsive {
     	width: 100%;
     	height: 10rem;
 	}
+	#leftbar, #rightbar {
+		display: none;
+	}
 }