Fix CSS-in-JS not working on homepage - CSS rules now properly rendered#27
Fix CSS-in-JS not working on homepage - CSS rules now properly rendered#27
Conversation
Co-authored-by: mahata <23497+mahata@users.noreply.github.com>
Co-authored-by: mahata <23497+mahata@users.noreply.github.com>
|
@copilot While CSS part is fixed, I'm getting the following error when I open By the way, the corresponding line is as follows: const messagesDiv = document.getElementById('messages');Please fix it. |
Co-authored-by: mahata <23497+mahata@users.noreply.github.com>
... Fixed! The JavaScript syntax error was caused by JSX HTML-encoding single quotes in the script tag, turning |
|
@copilot Fix CI in GitHub Actions. |
…ibutes Co-authored-by: mahata <23497+mahata@users.noreply.github.com>
Fixed! The CI linter error was caused by using |
Problem
The homepage at
/was rendering with generated CSS class names likecss-3719599696but the actual CSS rules were not being injected into the DOM. This resulted in unstyled content where the CSS-in-JS system was generating class names but not providing the corresponding styles.Before:

Root Cause
Hono's experimental CSS-in-JS system was not properly collecting and injecting styles during server-side rendering. While the
csstemplate literal function was generating unique class names, the<Style />component was rendering an empty<style id="hono-css">tag.Solution
Fixed the issue by:
createCssContextfromhono/cssto properly initialize the CSS-in-JS systemPromise.allto generate all CSS classes concurrentlyKey changes in
ChatPage.tsx:Result
After:

The homepage now renders correctly with:
Testing
Fixes #26.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.