88 public function __construct (
99 public string $ email = 'mc@netserva.org ' ,
1010 array $ in = ['o ' => 'Home ' , 'm ' => 'list ' , 'x ' => '' ],
11- public array $ out = ['doc ' => 'SPE::04 ' , 'head ' => '' , 'main ' => '' , 'foot ' => '' ],
11+ public array $ out = ['doc ' => 'SPE::04 ' , 'page ' => ' ← 04 Themes ' , ' head ' => '' , 'main ' => '' , 'foot ' => '' ],
1212 public array $ nav = [
1313 ['home ' , 'Home ' , 'Home ' ],
1414 ['book-open ' ,'About ' , 'About ' ],
@@ -56,12 +56,12 @@ public function list(): array { return ['head' => 'List', 'main' => 'Not imple
5656
5757final class HomeModel extends Plugin {
5858 #[\Override] public function list (): array {
59- return ['head ' => 'App Shell ' , 'main ' => 'Dual sidebar interface with <b>LHS navigation </b> and <b>RHS settings </b>. ' ];
59+ return ['head ' => 'Theme System ' , 'main ' => 'A modern CSS architecture using <b>OKLCH color space </b> and <b>mobile-first </b> responsive design . ' ];
6060 }
6161}
6262final class AboutModel extends Plugin {
6363 #[\Override] public function list (): array {
64- return ['head ' => 'About ' , 'main ' => 'This chapter introduces the <b>App Shell </b> pattern with pinnable sidebars . ' ];
64+ return ['head ' => 'App Shell ' , 'main ' => 'Dual sidebar interface with <b>LHS </b> and <b>RHS</b> navigation panels . ' ];
6565 }
6666}
6767final class ContactModel extends Plugin {
@@ -80,13 +80,49 @@ public function list(): string {
8080final class HomeView extends View {
8181 #[\Override] public function list (): string {
8282 return <<<HTML
83+ <div class="card">
84+ <h2> {$ this ->ary ['head ' ]}</h2>
85+ <p> {$ this ->ary ['main ' ]}</p>
86+ <h3>CSS Architecture</h3>
87+ <ul style="list-style:disc;padding-left:1.5rem;margin-top:0.5rem">
88+ <li><b>base.css</b> - Color-agnostic framework (layout, components, utilities)</li>
89+ <li><b>site.css</b> - All color definitions using OKLCH color space</li>
90+ </ul>
91+ <h3>OKLCH Color Space</h3>
92+ <ul style="list-style:disc;padding-left:1.5rem;margin-top:0.5rem">
93+ <li><b>Perceptually uniform</b> - Equal changes look equal visually</li>
94+ <li><b>L</b> (Lightness) - Consistent across all hues (0-100%)</li>
95+ <li><b>C</b> (Chroma) - Color intensity (0 = gray, 0.4 = vivid)</li>
96+ <li><b>H</b> (Hue) - Color angle (0-360°)</li>
97+ </ul>
98+ <h3>Color Schemes</h3>
99+ <ul style="list-style:disc;padding-left:1.5rem;margin-top:0.5rem">
100+ <li><b>Stone</b> (H=60) - Warm neutral, default theme</li>
101+ <li><b>Ocean</b> (H=220) - Cool cyan-blue tones</li>
102+ <li><b>Forest</b> (H=150) - Natural green palette</li>
103+ <li><b>Sunset</b> (H=45) - Warm orange-amber</li>
104+ </ul>
105+ <h3>Mobile-First Breakpoints</h3>
106+ <ul style="list-style:disc;padding-left:1.5rem;margin-top:0.5rem">
107+ <li><b>Mobile</b> (0-767px) - Base styles, full width</li>
108+ <li><b>Tablet</b> (768px+) - Cards gain borders/shadows</li>
109+ <li><b>Desktop</b> (1280px+) - Sidebar pinning enabled</li>
110+ </ul>
111+ </div>
112+ HTML ;
113+ }
114+ }
115+
116+ final class AboutView extends View {
117+ #[\Override] public function list (): string {
118+ return <<<HTML
83119<div class="card">
84120 <h2> {$ this ->ary ['head ' ]}</h2>
85121 <p> {$ this ->ary ['main ' ]}</p>
86122 <h3>Features</h3>
87123 <ul style="list-style:disc;padding-left:1.5rem;margin-top:0.5rem">
88- <li><b>LHS Sidebar </b> - Navigation (pages, posts)</li>
89- <li><b>RHS Sidebar </b> - Settings (theme, colors) </li>
124+ <li><b>LHS Panel </b> - Primary navigation (pages, posts)</li>
125+ <li><b>RHS Panel </b> - Secondary navigation, suited to settings </li>
90126 <li><b>Flyover</b> - Sidebars overlay content by default</li>
91127 <li><b>Pin</b> - Lock sidebars open on desktop (1280px+)</li>
92128 </ul>
@@ -101,8 +137,6 @@ final class HomeView extends View {
101137 }
102138}
103139
104- final class AboutView extends View {}
105-
106140final class ContactView extends View {
107141 #[\Override] public function list (): string {
108142 return <<<HTML
@@ -153,7 +187,7 @@ private function topnav(): string {
153187 return <<<HTML
154188<nav class="topnav">
155189 <button class="menu-toggle" data-sidebar="left"><i data-lucide="menu"></i></button>
156- <h1><a class="brand" href="/"><span> {$ this ->out ['doc ' ]}</span></a></h1>
190+ <h1><a class="brand" href="/"><span> {$ this ->out ['page ' ]}</span></a></h1>
157191 <button class="menu-toggle" data-sidebar="right"><i data-lucide="menu"></i></button>
158192</nav>
159193HTML ;
@@ -162,8 +196,9 @@ private function topnav(): string {
162196 private function sidebar (string $ side ): string {
163197 $ nav = $ side === 'left '
164198 ? $ this ->links ($ this ->ctx ->nav , 'o ' , $ this ->ctx ->in ['o ' ])
165- : '<a href="#" onclick="Base.toggleTheme();return false" data-icon="moon"><i data-lucide="moon"></i> Toggle Theme</a> '
166- . $ this ->colorLinks ();
199+ : $ this ->colorLinks ()
200+ . '<div class="sidebar-divider"></div> '
201+ . '<a href="#" onclick="Base.toggleTheme();return false" data-icon="moon"><i data-lucide="moon"></i> Toggle Theme</a> ' ;
167202 $ title = $ side === 'left ' ? 'Navigation ' : 'Settings ' ;
168203 $ icon = $ side === 'left ' ? 'compass ' : 'sliders-horizontal ' ;
169204 return <<<HTML
@@ -193,7 +228,7 @@ private function html(string $body): string {
193228 <link rel="stylesheet" href="/base.css">
194229 <link rel="stylesheet" href="/site.css">
195230 <script src="https://unpkg.com/lucide@latest/dist/umd/lucide.min.js"></script>
196- <script>(function(){var t= localStorage.getItem('theme'),c=localStorage.getItem(' scheme') ,h=document.documentElement;h.className=(t||(matchMedia('(prefers-color-scheme:dark)').matches?'dark':'light'))+(c&&c!=='default'?' scheme-'+c:'');})()</script>
231+ <script>(function(){var s=JSON.parse( localStorage.getItem('base-state')||'{}'),t=s.theme,c=s. scheme,h=document.documentElement;h.className='preload '+ (t||(matchMedia('(prefers-color-scheme:dark)').matches?'dark':'light'))+(c&&c!=='default'?' scheme-'+c:'');})()</script>
197232</head>
198233<body>
199234{$ body }
0 commit comments