feat(desktop): Let Custom Themes Include CSS

Merged
AT
6d ago
+694-7

What & why

Custom themes can now include CSS for artwork, animations, and other visual effects. CSS Tree parses stylesheets; a shared security policy filters them on import and again whenever the desktop applies a theme.

  • Block external/file/relative resource URLs, imports, SVG images, attribute extraction, legacy executable properties, and unsupported functions/at-rules. Allow embedded PNG/JPEG/WebP images.
  • Preserve visual styling, nesting, animations, and CSS layer order. Namespace custom properties to isolate them from app-owned CSS consumers; bound both input and generated CSS.
  • Show a translated import warning with a warning icon and restore keyboard focus on dismissal.
  • Allow themes without terminal overrides to persist.

CSS Tree handles parsing, not the security policy. Filtering is not a guarantee against browser vulnerabilities. Third-party selectors and color schemas may require adaptation; this is not a complete T3 skin importer.

Validation

53 shared theme tests and 12 desktop theme tests passed. Shared and desktop typechecks, repository lint, translation checks, and diff checks passed.

Verified import, selection, reload, replacement, removal, and warning dismissal in the real desktop app. Cancel and Escape return focus to Import. Tested Nebula, T3 Clawd, and an adapted Aurora Sky theme, including layered artwork and twinkle animation.

An isolated before/after browser probe sent a loopback tracking request before filtering and none afterward. Saved raw CSS was also filtered on reload.

Merge note

The maintainer explicitly authorized admin merge with the contributor's CLA signature outstanding. Signature collection remains open; the CLA check has not passed.