Token导航 LogoToken导航

Agent Skill · 前端设计

makepad-2.0-theme(makepad 2 0 主题)

makepad-2.0-theme 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

makepad-2.0-theme 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,暂无第三方扫描结果,按安装量在前端设计类的 10,216 个 Skill 里排第 8,476。

总安装 282周安装 12GitHub Stars 737下载 99核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:makepad-2.0-theme(makepad 2 0 主题)
来源仓库:https://github.com/zhanghandong/makepad-skills
仓库路径:skills/makepad-2.0-theme
安装命令:
npx skills add https://github.com/zhanghandong/makepad-skills --skill makepad-2.0-theme
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/zhanghandong/makepad-skills --skill makepad-2.0-theme

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于处理 GitHub 仓库与协作信息,支持主题相关 Issue 和 Pull Request。适合在 UI 开发流程中围绕代码变更和协作事项进行整理。需确认权限范围和维护状态,避免触发不必要的文件读写。建议在测试环境验证后再执行正式操作,确保稳定性。

makepad-2.0-theme 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/makepad-2.0-theme

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/zhanghandong/makepad-skills --skill makepad-2.…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

makepad-2.0-theme 怎么安装?

在终端执行 npx skills add https://github.com/zhanghandong/makepad-skills --skill makepad-2.0-theme。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

makepad-2.0-theme 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

makepad-2.0-theme 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

makepad-2.0-theme 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

makepad-2.0-theme 用的人多吗?

公开数据是累计安装 282 次,近一周安装 12 次,下载 99 次,GitHub 737 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

makepad-2.0-theme 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
makepad-2.0-theme

makepad 2 0 主题 · 本页

282737只读未明确未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

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:

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::widgets_mod(vm);

        // Step 4: Load your app's script_mod
        App::from_script_mod(vm, self::script_mod)
    }
}

If you skip steps 1-2, the default theme is dark (set inside theme_mod). The counter example uses the simplified one-liner crate::makepad_widgets::script_mod(vm) which bundles steps 1-3 with the default dark theme.

How It Works Internally

theme_mod() does the following:

  1. Calls makepad_draw::script_mod(vm) to load drawing primitives
  2. Creates the mod.themes module
  3. Loads theme_desktop_dark, theme_desktop_light, and theme_desktop_skeleton
  4. Sets mod.theme = mod.themes.dark as the default

Then widgets_mod() creates mod.prelude.widgets_internal with theme: mod.theme, making theme.* available in all widget scripts that use mod.prelude.widgets.*.

Theme Global Parameters

Each theme defines tunable global parameters that control the overall feel:

ParameterPurposeDefault (dark/light)
color_contrastControls color palette spread1.0
color_tintTint applied to backgrounds#0000ff
color_tint_amountHow much tint to apply (0-1)0.0
space_factorBase spacing multiplier6.0
corner_radiusBase corner radius2.5
bevelingBevel intensity0.75
font_size_baseBase font size in px10.0
font_size_contrastFont size step between levels2.5

Theme Color Variables -- Primary

These are the colors you will use most often in application code:

VariablePurposeLight AppearanceDark Appearance
theme.color_bg_appApp backgroundLight gray (~#DDD)Dark gray (~#333)
theme.color_fg_appForeground layerSlightly darkerSlightly lighter
theme.color_bg_containerCard/container bgSemi-transparent lightSemi-transparent dark
theme.color_bg_evenAlternating row (even)LighterDarker
theme.color_bg_oddAlternating row (odd)DarkerLighter
theme.color_bg_highlightHighlight backgroundWhite-ish #FFFFFF22White-ish low opacity
theme.color_bg_highlight_inlineInline highlightcolor_d_1color_d_3
theme.color_bg_unfocussedUnfocused highlight85% of bg_highlight85% of bg_highlight
theme.color_app_caption_barCaption bar bgTransparentTransparent
theme.color_whitePure white#FFFFFF#FFFFFF
theme.color_makepadMakepad brand#FF5C39#FF5C39

Theme Color Variables -- Text and Labels

VariablePurpose
theme.color_label_innerPrimary text on inner elements (buttons, labels)
theme.color_label_inner_hoverText on hover
theme.color_label_inner_downText when pressed
theme.color_label_inner_focusText when focused
theme.color_label_inner_activeText when active/selected
theme.color_label_inner_inactiveSecondary/muted text
theme.color_label_inner_disabledDisabled text
theme.color_label_outerPrimary text on outer elements (tabs, headers)
theme.color_label_outer_offOuter text when off
theme.color_label_outer_disabledDisabled outer text
theme.color_textGeneral text color
theme.color_text_hoverText on hover
theme.color_text_focusText on focus
theme.color_text_disabledDisabled text
theme.color_text_placeholderPlaceholder text
theme.color_text_metaMetadata text
theme.color_text_cursorText cursor color

Theme Color Variables -- Widget States

Outset colors (buttons, raised elements):

VariablePurpose
theme.color_outsetDefault button background
theme.color_outset_hoverButton on hover
theme.color_outset_downButton when pressed
theme.color_outset_activeActive toggle state
theme.color_outset_focusFocused button
theme.color_outset_disabledDisabled button
theme.color_outset_inactiveInactive button

Inset colors (text inputs, checkboxes, radio buttons):

VariablePurpose
theme.color_insetDefault input background
theme.color_inset_hoverInput on hover
theme.color_inset_focusInput on focus
theme.color_inset_disabledDisabled input
theme.color_inset_emptyEmpty input

Selection and highlight:

VariablePurpose
theme.color_selection_focusText selection highlight
theme.color_selection_hoverSelection on hover
theme.color_highlightGeneral accent/highlight
theme.color_cursorCursor color
theme.color_cursor_focusFocused cursor

Theme Color Variables -- Semantic/Status

VariablePurposeValue
theme.color_errorError stateRed (#C00)
theme.color_warningWarning stateOrange (#FA0)
theme.color_highHigh severityRed (#C00)
theme.color_midMedium severityOrange (#FA0)
theme.color_lowLow severityYellow-green (#8A0)
theme.color_panicPanic/criticalMagenta (#f0f)

Theme Color Variables -- Bevel System

The theme has a layered bevel system for 3D-like widget effects:

GroupVariablesPurpose
color_bevel*_hover, _focus, _active, _down, _disabledFlat bevel
color_bevel_inset_1*Same suffixesInner shadow (layer 1)
color_bevel_inset_2*Same suffixesInner highlight (layer 2)
color_bevel_outset_1*Same suffixesOuter highlight (layer 1)
color_bevel_outset_2*Same suffixesOuter shadow (layer 2)

Theme Color Variables -- Additional Widget Colors

Variable GroupPurpose
theme.color_icon*Icon colors (default, inactive, active, disabled)
theme.color_mark*Checkmark/radio mark colors
theme.color_val*Progress bar and slider fill colors
theme.color_handle*Slider handle colors
theme.color_shadow*Shadow effects
theme.color_drag_quadDrag preview overlay
theme.color_dock_tab_activeActive dock tab background

Theme Font Variables

Font Sizes

Font sizes are computed from font_size_base and font_size_contrast:

VariableFormulaDefault Value
theme.font_size_1base + 8 * contrast30.0 (largest heading)
theme.font_size_2base + 4 * contrast20.0 (medium heading)
theme.font_size_3base + 2 * contrast15.0 (small heading)
theme.font_size_4base + 1 * contrast12.5 (subheading)
theme.font_size_pbase10.0 (body text)
theme.font_size_codefixed9.0 (monospace code)

Font Styles (TextStyle objects)

VariableDescriptionFont File
theme.font_regularRegular weight body textIBMPlexSans-Text.ttf
theme.font_boldBold/semibold textIBMPlexSans-SemiBold.ttf
theme.font_italicItalic textIBMPlexSans-Italic.ttf
theme.font_bold_italicBold italic textIBMPlexSans-BoldItalic.ttf
theme.font_codeMonospace code fontLiberationMono-Regular.ttf
theme.font_labelLabel text (legacy)IBMPlexSans-Text.ttf
theme.font_iconsIcon font (FontAwesome)fa-solid-900.ttf

Each font style includes multi-language support:

  • Latin: IBM Plex Sans family
  • Chinese: LXGW WenKai family
  • Emoji: Noto Color Emoji

Line Spacing Constants

VariableValuePurpose
theme.font_wdgt_line_spacing1.2Widget text
theme.font_hl_line_spacing1.05Heading text
theme.font_longform_line_spacing1.2Long-form text

Theme Spacing Variables

Base Spacing

Spacing is derived from space_factor (default 6.0):

VariableFormulaDefault Value
theme.space_10.5 * space_factor3.0 (extra small)
theme.space_21.0 * space_factor6.0 (small/standard)
theme.space_31.5 * space_factor9.0 (medium)

Margin/Padding Presets (Inset objects)

All-sides presets:

VariableDescriptionValues
theme.mspace_1XS padding all sides3px each
theme.mspace_2SM padding all sides6px each
theme.mspace_3MD padding all sides9px each

Horizontal-only presets:

VariableDescriptionValues
theme.mspace_h_1XS horizontal paddingleft/right: 3px, top/bottom: 0
theme.mspace_h_2SM horizontal paddingleft/right: 6px, top/bottom: 0
theme.mspace_h_3MD horizontal paddingleft/right: 9px, top/bottom: 0

Vertical-only presets:

VariableDescriptionValues
theme.mspace_v_1XS vertical paddingtop/bottom: 3px, left/right: 0
theme.mspace_v_2SM vertical paddingtop/bottom: 6px, left/right: 0
theme.mspace_v_3MD vertical paddingtop/bottom: 9px, left/right: 0

Dimension Variables

VariablePurposeDefault
theme.data_item_heightStandard data row height~23px
theme.data_icon_widthStandard icon width~16px
theme.data_icon_heightStandard icon height~22px
theme.container_corner_radiusContainer border radius5.0
theme.textselection_corner_radiusText selection radius1.25
theme.tab_heightTab bar height36.0

Using Theme Variables in Splash

Colors

// Background color
draw_bg.color: theme.color_bg_container

// Text color
draw_text.color: theme.color_label_inner

// Muted/secondary text
draw_text.color: theme.color_label_inner_inactive

// Color math -- multiply for opacity
draw_text.color: theme.color_label_inner_inactive * 0.8

// Semantic colors
draw_bg.color: theme.color_warning
draw_bg.color: theme.color_error

Font Sizes

// Body text size
draw_text.text_style.font_size: theme.font_size_p

// Heading sizes
draw_text.text_style.font_size: theme.font_size_1   // Largest
draw_text.text_style.font_size: theme.font_size_2   // Medium
draw_text.text_style.font_size: theme.font_size_3   // Small
draw_text.text_style.font_size: theme.font_size_4   // Sub-heading

// Code font size
draw_text.text_style.font_size: theme.font_size_code

Font Styles

// Bold text with custom size (override with {} syntax)
draw_text.text_style: theme.font_bold{font_size: theme.font_size_2}

// Bold text keeping default size
draw_text.text_style: theme.font_bold{}

// Code font
draw_text.text_style: theme.font_code{}

// Override font size using +: merge syntax
draw_text +: {text_style +: {font_size: theme.font_size_3}}

Spacing

// Uniform padding
padding: theme.mspace_2

// Padding with overrides
padding: theme.mspace_2{left: theme.space_3, right: theme.space_3}

// Horizontal-only padding with custom values
padding: theme.mspace_h_1{left: theme.space_2, right: theme.space_2}

// Spacing between children
spacing: theme.space_2

// Computed spacing
width: Fill height: 9. * theme.space_1
padding: theme.mspace_3{left: theme.space_3 * 2, right: theme.space_3 * 2}

Color Syntax Reference

Splash supports multiple color formats (not theme-specific but essential):

SyntaxExampleDescription
#RGB#f00Short hex (red)
#RRGGBB#ff0000Full hex
#RRGGBBAA#ff000080Hex with alpha
#xRRGGBB#x2ecc71Hex starting with e (prefix #x)
#N#DGrayscale shorthand
vec4(r,g,b,a)vec4(1.0, 0.0, 0.0, 1.0)RGBA float (0.0-1.0)
theme.*theme.color_highlightTheme variable

Important: When a hex color starts with the letter e, use the #x prefix to avoid ambiguity with scientific notation. For example, #x2ecc71 not #2ecc71.

Color math is supported:

// Multiply for opacity
theme.color_label_inner_inactive * 0.8

// Mix two colors
mix(theme.color_w, theme.color_b, 0.5)

Theme Switching at Runtime

You can switch themes dynamically in Rust event handlers:

impl MatchEvent for App {
    fn handle_actions(&mut self, cx: &mut Cx, actions: &Actions) {
        if self.ui.button(cx, ids!(toggle_theme)).clicked(actions) {
            script_eval!(cx, {
                mod.theme = mod.themes.dark  // or mod.themes.light
            });
            // All widgets using theme.* will pick up new values
            // You may need to trigger a re-render
        }
    }
}

Or switch before widgets load (in App::run) for a static theme choice:

fn run(vm: &mut ScriptVm) -> Self {
    crate::makepad_widgets::theme_mod(vm);
    script_eval!(vm, {
        mod.theme = mod.themes.light
    });
    crate::makepad_widgets::widgets_mod(vm);
    App::from_script_mod(vm, self::script_mod)
}

Complete Theme-Aware UI Example

This example demonstrates a themed card list using only theme variables:

script_mod! {
    use mod.prelude.widgets.*

    let CardItem = RoundedView{
        width: Fill height: Fit
        padding: theme.mspace_2{left: theme.space_3, right: theme.space_3}
        flow: Right spacing: theme.space_2
        align: Align{y: 0.5}
        draw_bg.color: theme.color_bg_container
        draw_bg.border_radius: theme.container_corner_radius

        icon := Label{
            width: 24 height: 24
            text: ""
        }
        content := View{
            width: Fill height: Fit
            flow: Down spacing: theme.space_1
            title := Label{
                text: "Title"
                draw_text.color: theme.color_label_inner
                draw_text.text_style: theme.font_bold{font_size: theme.font_size_4}
            }
            subtitle := Label{
                text: "Subtitle"
                draw_text.color: theme.color_label_inner_inactive
                draw_text.text_style.font_size: theme.font_size_p
            }
        }
        badge := RoundedView{
            width: Fit height: Fit
            padding: theme.mspace_h_1
            draw_bg.color: theme.color_bg_highlight_inline
            draw_bg.border_radius: 4.0
            badge_label := Label{
                text: "new"
                draw_text.color: theme.color_highlight
                draw_text.text_style.font_size: theme.font_size_code
                draw_text.text_style: theme.font_bold{}
            }
        }
    }

    startup() do #(App::script_component(vm)){
        ui: Root{
            main_window := Window{
                pass.clear_color: theme.color_bg_app
                window.inner_size: vec2(400, 600)
                body +: {
                    width: Fill height: Fill
                    flow: Down spacing: 0

                    // Header
                    SolidView{
                        width: Fill height: Fit
                        padding: theme.mspace_3
                        draw_bg.color: theme.color_app_caption_bar
                        Label{
                            text: "My Cards"
                            draw_text.color: theme.color_label_inner
                            draw_text.text_style: theme.font_bold{font_size: theme.font_size_2}
                        }
                    }

                    // Card list
                    ScrollYView{
                        width: Fill height: Fill
                        padding: theme.mspace_2
                        flow: Down spacing: theme.space_1
                        CardItem{title.text: "First Card" subtitle.text: "Description here"}
                        CardItem{title.text: "Second Card" subtitle.text: "Another card"}
                    }

                    // Footer
                    SolidView{
                        width: Fill height: Fit
                        padding: theme.mspace_2
                        draw_bg.color: theme.color_bg_container
                        Label{
                            text: "2 items"
                            draw_text.color: theme.color_label_inner_inactive
                            draw_text.text_style.font_size: theme.font_size_code
                        }
                    }
                }
            }
        }
    }
}

Best Practices

  1. **ALWAYS use theme.* for colors in production apps** -- never hardcode #ff0000 when theme.color_error exists. This enables theme switching and accessibility.
  2. Use theme fonts for consistent typography -- prefer theme.font_bold{font_size: theme.font_size_2} over manually specifying font families.
  3. Use theme spacing for consistent layout -- theme.mspace_2 and theme.space_2 create a harmonious rhythm. Avoid magic numbers like padding: Inset{top: 8,...}.
  4. Override with {} syntax -- extend theme values without replacing them: theme.font_bold{font_size: 20} keeps the bold font family but overrides size. theme.mspace_2{left: theme.space_3} keeps top/right/bottom but overrides left.
  5. Use merge +: for partial overrides -- when you only want to change one nested property: draw_text +: {text_style +: {font_size: theme.font_size_3}}
  6. Choose the right text color variable:

- theme.color_label_inner for primary UI text (buttons, labels) - theme.color_label_inner_inactive for secondary/muted text - theme.color_text for general content text - theme.color_text_placeholder for placeholder text

  1. Use state-aware color variants -- widgets that change on hover/focus/press should use the matching _hover, _focus, _down suffixes.
  2. Multiply for subtle opacity -- theme.color_label_inner_inactive * 0.8 creates a subtler variant without a new variable.
  3. Select theme before widgets_mod -- the theme must be set between theme_mod() and widgets_mod() calls, so widget definitions pick up the correct theme values.
  4. For simple apps, use crate::makepad_widgets::script_mod(vm) which loads everything with the default dark theme in one call.

Source Files

  • Theme dark: widgets/src/theme_desktop_dark.rs
  • Theme light: widgets/src/theme_desktop_light.rs
  • Theme skeleton: widgets/src/theme_desktop_skeleton.rs
  • Theme loader: widgets/src/lib.rs (theme_mod and widgets_mod functions)
  • Example usage: examples/todo/src/app.rs (light theme with full theme variable usage)
  • Example usage: examples/counter/src/app.rs (default dark theme)

平台分布

Codex

33.25%
按下载量换算33

Claude

31.4%
按下载量换算31

Cursor

19.38%
按下载量换算19

Gemini CLI

8.54%
按下载量换算8

安全审计

暂无安全审计结果可展示。

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills