Skip to content

feat(branding): beginner-friendly custom CSS (live preview + starter snippets)#179

Merged
Musiker15 merged 1 commit into
mainfrom
feat/custom-css-beginner-friendly
Jul 2, 2026
Merged

feat(branding): beginner-friendly custom CSS (live preview + starter snippets)#179
Musiker15 merged 1 commit into
mainfrom
feat/custom-css-beginner-friendly

Conversation

@Musiker15

Copy link
Copy Markdown
Member

Customer suggestion: a more beginner-friendly approach to custom CSS, e.g. a preview option or recommended things to change.

Custom CSS was a bare textarea with no feedback. This makes it approachable in two ways.

Live preview

A sample of the guild's public form, rendered in a sandboxed iframe with the current accent color and custom CSS applied instantly, without saving. As the manager edits the CSS (or picks snippets), the preview updates live.

  • Fully isolated: sandbox="" (no scripts, no dashboard leakage), CSS sanitized the same way as on save/render.
  • Mirrors the live page's token system: the same .msk-form wrapper and CSS-variable names/values from globals.css, light/dark aware (follows the dashboard theme).

Quick styles (recommended things to change)

One-click starter snippets inserted into the editor: Rounded corners, Accent background, Larger text, Colored heading. Each targets .msk-form or a CSS variable, i.e. the two documented, stable hooks, so a snippet behaves identically in the preview and on the live page. The manager can then tweak the values.

Details

  • New client component components/branding/css-preview.tsx.
  • branding-form.tsx gains the snippet row and the preview (Pro-gated, same as the CSS field).
  • i18n: preview/snippet labels and sample content in all 7 locales.
  • No schema/env change.

Checks

Typecheck, lint, test (shared 83 / web 40 / bot 4), build all green.

…snippets)

Custom CSS was a bare textarea with no feedback. Make it approachable:

- Live preview: a sample public form rendered in a sandboxed iframe with the
  guild's accent color and custom CSS applied instantly (no save needed). The
  iframe is fully isolated (sandbox="", CSS sanitized the same way as on save),
  so rules can't leak into the dashboard or run scripts, and it mirrors the
  live page's token system (.msk-form + CSS variables, light/dark aware).
- Quick styles: one-click starter snippets (rounded corners, accent background,
  larger text, colored heading) inserted into the editor. Each targets
  .msk-form or a CSS variable, so it works identically in preview and live.

i18n for the new labels, snippet names and sample content in all 7 locales.
No schema/env change.
@Musiker15 Musiker15 merged commit 53c4dee into main Jul 2, 2026
3 checks passed
@Musiker15 Musiker15 deleted the feat/custom-css-beginner-friendly branch July 2, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant