gum-theming

Author Gum theme packages by subclassing V3 default visuals to restyle Forms controls.

614|78|Updated Mar 11, 2015
One-click install
npx skills add https://github.com/vchelaru/Gum --skill gum-theming
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gum-theming
Source: https://github.com/vchelaru/Gum/tree/main/.claude/skills/gum-theming
Command: npx skills add https://github.com/vchelaru/Gum --skill gum-theming

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building a custom visual theme for Gum Forms controls requires deep knowledge of the V3 default visual hierarchy, state callback wiring, font embedding, and cross-runtime NuGet packaging — mistakes like misordered clip containers, swallowed click events, or missing font glyphs only surface at runtime. This Skill encodes the conventions, pitfalls, and step-by-step recipe for authoring a complete theme package.

Core Features & Use Cases

  • Template-based theme authoring: Clone the Gum.Themes.Template project, rename the six theme-owned types, transcribe CSS design tokens into a Colors class, and restyle each control's visual subclass.
  • Rendering guidance: Covers NineSlice vs Apos.Shapes primitives, native drop shadows, dashed strokes, rounded-outline clipping tricks, and icon font bundling with DejaVu Sans Mono.
  • Cross-runtime packaging: Explains the MonoGame/KNI/raylib multi-project source-sharing pattern, embedded font resource naming, and KernSmith dependency configuration.
  • Use Case: A developer receives a CSS/HTML mockup for their game's UI and needs to turn it into a shippable Gum.Themes.* NuGet package that restyles every Forms control with one Apply() call.

Quick Start

Use the gum-theming skill to create a new Gum theme from the template project that matches my CSS design mockup.

Frequently Asked Questions about gum-theming

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a custom Gum theme for Forms controls?

Clone the Gum.Themes.Template.MonoGame project and its KNI sibling, rename the six theme-owned types, transcribe your design's CSS custom properties into the Colors class, swap the embedded fonts, then restyle each control by subclassing its V3 default visual. Verify by running the theme in the MonoGameGumThemesShowcase project.

How do I restyle a Gum Button or TextBox visual?

Subclass the corresponding Gum.Forms.DefaultVisuals.V3 visual, detach the children you are replacing, add your replacement NineSlice or Apos.Shapes primitives, and re-wire state callbacks with assignment rather than += so the base class color logic is fully replaced.

Should I use NineSlice or Apos.Shapes for Gum theme visuals?

NineSlice with a retextured sprite sheet is the lightest approach, while Apos.Shapes enables rounded corners, circles, dashed strokes, and native drop shadows at the cost of a ShapeRenderer initialization. You can mix both, using NineSlice for large panels and shapes for small interactive controls.

Why does my Gum control not register clicks after theming?

ContainerRuntime sets HasEvents to true by default, so a wrapper container inside your visual captures clicks meant for the control root. Set HasEvents to false on any sub-container you introduce, except thumb visuals which need it for drag pickup.

Why do custom fonts fail at runtime in a Gum theme?

KernSmith only rasterizes static TTFs and cannot select instances from variable fonts, so fetch static weight cuts of VF-only fonts. Also keep AssemblyName and RootNamespace equal, since fonts are looked up by assembly name but embedded under the root namespace.

Can one NuGet package support both MonoGame and KNI?

No, because both Gum.MonoGame and Gum.KNI target net8.0, NuGet cannot discriminate by TFM. Ship two packages where the KNI project source-shares the MonoGame project's files and re-embeds fonts with Link metadata.