Move example CSS to basics.css, pretty-print wire response, update sx logo

- Move .sx-fade-in and .sx-loading-btn CSS from inline (style) tags to
  basics.css so they go through the on-demand CSS registry
- Pretty-print sx source in wire response display (not all on one line)
- Change sx logo from </> icon to (</>) text

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-03 08:45:54 +00:00
parent 002cc49f2c
commit 5dd1161816
3 changed files with 28 additions and 5 deletions

View File

@@ -101,8 +101,13 @@ def _full_wire_text(sx_src: str, *comp_names: str) -> str:
if comp_text:
parts.append(f'<script type="text/sx" data-components>\n{comp_text}\n</script>')
parts.append('<style data-sx-css>/* new CSS rules */</style>')
parts.append(sx_src)
return "\n".join(parts)
# Pretty-print the sx source for readable display
try:
from shared.sx.parser import parse as _parse, serialize as _serialize
parts.append(_serialize(_parse(sx_src), pretty=True))
except Exception:
parts.append(sx_src)
return "\n\n".join(parts)
# ---------------------------------------------------------------------------
@@ -125,7 +130,8 @@ def _sx_header_sx(nav: str | None = None, *, child: str | None = None) -> str:
"""Build the sx docs menu-row."""
return sx_call("menu-row-sx",
id="sx-row", level=1, colour="violet",
link_href="/", link_label="sx", icon="fa fa-code",
link_href="/", link_label="sx",
link_label_content=SxExpr('(span :class "font-mono" "(</>) sx")'),
nav=SxExpr(nav) if nav else None,
child_id="sx-header-child",
child=SxExpr(child) if child else None,