Loading...
Loading...
CRITICAL: Use for Makepad DSL syntax and inheritance. Triggers on: makepad dsl, live_design, makepad inheritance, makepad prototype, "<Widget>", "Foo = { }", makepad object, makepad property, makepad DSL 语法, makepad 继承, makepad 原型, 如何定义 makepad 组件
npx skill4agent add zhanghandong/makepad-skills makepad-dslVersion: makepad-widgets (dev branch) | Last Updated: 2026-01-19Check for updates: https://crates.io/crates/makepad-widgets
makepad-widgets./references/dsl-syntax.md./references/inheritance.md/sync-crate-skills makepad --force{
width: 100.0
height: 50.0
color: #FF0000
}MyButton = {
width: Fit
height: 40.0
padding: 10.0
draw_bg: { color: #333333 }
}PrimaryButton = <MyButton> {
draw_bg: { color: #0066CC } // Override parent color
draw_text: { color: #FFFFFF } // Add new property
}<View> {
// Inherits from View prototype
width: Fill
height: Fill
<Button> { text: "Click Me" } // Child widget
<Label> { text: "Hello" } // Another child
}// In live_design!
MyWidget = {{MyWidget}} {
// DSL properties
width: 100.0
}
// In Rust
#[derive(Live, LiveHook, Widget)]
pub struct MyWidget {
#[deref] view: View,
#[live] width: f64,
}| Syntax | Description | Example |
|---|---|---|
| Anonymous object | |
| Named prototype | |
| Inherit from prototype | |
| Link to Rust struct | |
| Named child widget | |
| Resource dependency | |
| Type | Example | Description |
|---|---|---|
| Number | | Float value |
| Color | | RGBA hex color |
| String | | Text string |
| Enum | | Enum variant |
| Size | | Fit, Fill, or numeric |
| Object | | Nested object |
| Array | | List of values |
Parent = {
a: 1
nested: { x: 10, y: 20 }
}
Child = <Parent> {
a: 2 // Override a
b: 3 // Add new property
nested: { x: 30 } // Override only x, y remains 20
}<Widget>{{RustType}}live_design!