Agent skill · Design & Presentation

makepad-2.0-theme

makepad theme, theme variable, theme color, theme font, theme spacing, dark mode, light mode, theme switching, mod.themes, theme_mod, theme.color_, theme.font_, theme.space_, theme.mspace_, 主题, 颜色, 字体, 暗色模式, 亮色模式, 主题切换, 样式

ZhangHanDonggithub.com/ZhangHanDongGitHub ↗
claude-code
Install
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-theme --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 20 KB
Bundled scripts: none
Path: skills/makepad-2.0-theme/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 745

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Defines a theme system for Makepad 2.0 that exposes a comprehensive set of design tokens through theme.* variables. Provides three built-in themes (mod.themes.dark, mod.themes.light, mod.themes.skeleton) and enforces using theme variables over hardcoded values. Includes a pattern to load themes before widgets, switch active themes at runtime, and propagate theme values to widgets. Documents a wide range of theme parameters (colors, fonts, spacing, bevels, and more) and instructions for using those variables in Splash scripts. Three built-in themes and a default dark theme are specified, with a procedure to initialize theme_mod(vm) and widgets_mod(vm) in App::run.

How it works

  1. Calls makepad_draw::script_mod(vm) to load drawing primitives and creates mod.themes and loads theme_desktop_dark, theme_desktop_light, and theme_desktop_skeleton.
  2. Sets mod.theme = mod.themes.dark as the default.
  3. Exposes theme.* tokens to all widget scripts via widgets_mod(vm) so widgets can reference the active theme.
  4. Provides runtime switching: in Rust event handlers, use script_eval!(..., { mod.theme = mod.themes.dark or mod.themes.light }); and potentially trigger a re-render.
  5. Encourages loading the theme before widgets and selecting the active theme before widgets_mod is called.
  6. Describes how to apply theme variables for colors, font sizes, font styles, and spacing in Splash code and how to compose UI using theme.* tokens.

When to use it

Use when you want a centralized, switchable theme system for a Makepad 2.0 app, ensuring colors, typography, and spacing respond to theme changes and remain consistent across widgets. Triggers include phrases like makepad theme, theme variable, theme color, theme font, theme spacing, dark mode, light mode, theme switching, mod.themes, theme_mod, theme.color_, theme.font_, theme.space_, theme.mspace_, 主题, 颜色, 字体, 暗色模式, 亮色模式, 主题切换, 样式.

What it can touch

  • Tokens via theme.* variables in Splash scripts (colors, fonts, spacing, widget states).
  • Theme modules loaded through makepad_widgets::theme_mod(vm) and widgets_mod(vm).
  • Runtime switch via script_eval!(vm, { mod.theme = mod.themes.dark|light }).

Caveats

  • Default theme is dark when steps 1-2 are skipped.
  • Requires loading theme_definitions before widgets for proper propagation.
  • Describes specific default values for many parameters (e.g., color_contrast, space_factor, font_size_base), which should be used as reference for consistent styling.
From the SKILL.md

# Makepad 2.0 Theme System ## Overview The Makepad 2.0 theme system provides a comprehensive set of design tokens accessed through `theme.*` variables in Splash scripts. It delivers consistent styling for colors, typography, spacing, and widget states across your entire application. Three built-in themes are available: - `mod.themes.dark` -- dark desktop theme (default) - `mod.themes.light` -- light desktop theme - `mod.themes.skeleton` -- minimal skeleton theme with hardcoded values **Golden rule**: Always use `theme.*` variables instead of hardcoded values for any color, font size, or spacing in production UIs. This ensures your app automatically supports theme switching and maintains visual consistency. ## Theme Setup in App::run The theme must be loaded **before** widgets are loaded. The standard pattern is: ```rust impl App { fn run(vm: &mut ScriptVm) -> Self { // Step 1: Load theme definitions (dark, light, skeleton) crate::makepad_widgets::theme_mod(vm); // Step 2: Select active theme (MUST come before widgets_mod) script_eval!(vm, { mod.theme = mod.themes.light // or mod.themes.dark }); // Step 3: Load widget definitions (they reference mod.theme) crate::makepad_widgets::wi

What's inside
Steps it walks through
  1. Overview
  2. Theme Setup in App::run
  3. How It Works Internally
  4. Theme Global Parameters
  5. Theme Color Variables -- Primary
  6. Theme Color Variables -- Text and Labels
  7. Theme Color Variables -- Widget States
  8. Theme Color Variables -- Semantic/Status
  9. Theme Color Variables -- Bevel System
  10. Theme Color Variables -- Additional Widget Colors
  11. Theme Font Variables
  12. Font Sizes
  13. Font Styles (TextStyle objects)
  14. Line Spacing Constants
Ships with 1 file
  • references/theme-variables.md
More from makepad-skills
All skills →
About this skill
What does the makepad-2.0-theme skill do?

makepad theme, theme variable, theme color, theme font, theme spacing, dark mode, light mode, theme switching, mod.themes, theme_mod, theme.color_, theme.font_, theme.space_, theme.mspace_, 主题, 颜色, 字体, 暗色模式, 亮色模式, 主题切换, 样式

How do I install it?

Run `npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-theme --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ZhangHanDong/makepad-skills, a repository with 745 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going