best-practices: Styling (self-host your stylesheet) - #11
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Adds best-practice guidance for plugin styling so runtime-installed plugins don’t render unstyled due to missing utility classes in the Host’s compiled stylesheet.
Changes:
- Introduces a new Styling section with rules to ship a compiled plugin stylesheet via
styles. - Documents coexistence constraints (disable global reset, scope selectors, avoid CDN/runtime CSS engines, bump
versionto cache-bust assets). - Updates Shipping rule numbering and adds a matching styling checklist block; records the change in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| spec/best-practices.md | Adds “Styling” rules (38–39), renumbers “Shipping” (40–44), and extends the publish checklist with styling guidance. |
| CHANGELOG.md | Notes the addition of the new “Styling” best-practices section and its key requirements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6999ed5 to
b11d019
Compare
Add a Styling section: the app's compiled stylesheet only contains classes the bundled code uses, so a runtime-installed plugin renders unstyled unless it ships its own CSS. Rules (38-39): - Ship your own compiled stylesheet via `styles` (under assets/), containing every class your screen needs — don't assume a utility class exists just because the app uses a similar one (esp. arbitrary values like w-[37px]). - Build it to coexist: base/preflight reset OFF (don't re-reset the whole app), selectors scoped to your screen, never the Tailwind Play CDN or a runtime CSS engine (slow, offline-hostile, main-thread), and bump `version` to cache-bust. Renumber Shipping to 40-44 and add a checklist block. Docs only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: K. O. A. <topkoa@gmail.com>
CSS scoping guidance lives in rule 7 (namespacing), not rule 10 (don't mutate the shell). Signed-off-by: K. O. A. <topkoa@gmail.com>
fe9743a to
a7fcc71
Compare
Summary
Third of four gap-closing PRs. Adds a "Styling" section. The app's compiled stylesheet only contains the utility classes the bundled code uses — so a plugin installed at runtime (plugin manager, shared folder, community) renders unstyled unless it ships its own CSS. A shipping blocker that wasn't covered.
Rules (38–39)
styles. Pointstylesat a compiled CSS file (underassets/) containing every class your screen needs. Don't assume a utility class exists because the app uses a similar one — especially arbitrary-value utilities (w-[37px],bg-slate-800/50) that are generated on demand and almost never in the app's sheet. Ship the compiled output, not a config.corePlugins.preflight = false) so you don't re-style the whole app; selectors scoped to your screen (rule 10); never the Tailwind Play CDN or a runtime CSS-in-JS/JIT (slow, unavailable offline — feedBack is local-first, recompiles on the main thread); bumpversionto cache-bust the sheet.Added a "Styling" checklist block; Shipping renumbered to 40–44 (contiguous 1–44).
Scope & stacking
Docs only. Stacked on #10. Full stack: … → #9 → #10 → #11 (one more: diagnostics).
mkdocs build --strict+check_versions.pypass.🤖 Generated with Claude Code