npx claudepluginhub sickn33/antigravity-awesome-skillsThis skill uses the workspace's default tool permissions.
> **Version:** makepad-widgets (dev branch) | **Last Updated:** 2026-01-19
Guides Makepad cross-platform development using OsType enum for platform detection, conditional compilation, and graphics backends like Metal, D3D11, OpenGL, WebGL for desktop, mobile, web.
Routes Makepad 2.0 GUI questions to specialized skills and applies design anchors for architecture, component splitting, state management, data flow, and rendering.
Designs native-feeling macOS UIs for desktop apps with sidebar layouts, traffic lights, interactions, micro-animations, light/dark mode, and effects via React, CSS, or Electron.
Share bugs, ideas, or general feedback.
Version: makepad-widgets (dev branch) | Last Updated: 2026-01-19
Check for updates: https://crates.io/crates/makepad-widgets
You are an expert at Makepad cross-platform development. Help users by:
Refer to the local files for detailed documentation:
./references/platform-support.md - Platform details and OsTypeBefore answering questions, Claude MUST:
/sync-crate-skills makepad --force 更新文档"| Platform | Graphics Backend | OS Module |
|---|---|---|
| macOS | Metal | apple/metal_*.rs, apple/cocoa_*.rs |
| iOS | Metal | apple/metal_*.rs, apple/ios_*.rs |
| Windows | D3D11 | mswindows/d3d11_*.rs, mswindows/win32_*.rs |
| Linux | OpenGL | linux/opengl_*.rs, linux/x11*.rs, linux/wayland*.rs |
| Web | WebGL2 | web/*.rs, web_browser/*.rs |
| Android | OpenGL ES | android/*.rs |
| OpenHarmony | OHOS | open_harmony/*.rs |
| OpenXR | VR/AR | open_xr/*.rs |
pub enum OsType {
Unknown,
Windows,
Macos,
Linux { custom_window_chrome: bool },
Ios,
Android(AndroidParams),
OpenHarmony,
Web(WebParams),
OpenXR,
}
// Check platform in code
fn handle_event(&mut self, cx: &mut Cx, event: &Event) {
match cx.os_type() {
OsType::Macos => { /* macOS-specific */ }
OsType::Windows => { /* Windows-specific */ }
OsType::Web(_) => { /* Web-specific */ }
_ => {}
}
}
// In Cx
impl Cx {
pub fn os_type(&self) -> OsType;
pub fn gpu_info(&self) -> &GpuInfo;
pub fn xr_capabilities(&self) -> &XrCapabilities;
pub fn cpu_cores(&self) -> usize;
}
// Compile-time platform detection
#[cfg(target_os = "macos")]
fn macos_only() { }
#[cfg(target_os = "windows")]
fn windows_only() { }
#[cfg(target_os = "linux")]
fn linux_only() { }
#[cfg(target_arch = "wasm32")]
fn web_only() { }
#[cfg(target_os = "android")]
fn android_only() { }
#[cfg(target_os = "ios")]
fn ios_only() { }
// App entry macro
app_main!(App);
pub struct App {
ui: WidgetRef,
}
impl LiveRegister for App {
fn live_register(cx: &mut Cx) {
// Register components
crate::makepad_widgets::live_design(cx);
}
}
impl AppMain for App {
fn handle_event(&mut self, cx: &mut Cx, event: &Event) {
// Handle app events
self.ui.handle_event(cx, event, &mut Scope::empty());
}
}
platform/src/os/ directorycx.os_type() for runtime platform detection#[cfg(target_os = "...")] for compile-time platform detection