gpui-layout-and-style

Style GPUI components with CSS-like properties in Rust.

12.5k|757|Updated Jun 13, 2024
One-click install
npx skills add https://github.com/longbridge/gpui-component --skill gpui-layout-and-style-longbridge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gpui-layout-and-style
Source: https://github.com/longbridge/gpui-component/tree/main/.claude/skills/gpui-layout-and-style
Command: npx skills add https://github.com/longbridge/gpui-component --skill gpui-layout-and-style-longbridge

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Styling GPUI components can be verbose and inconsistent; this skill introduces a CSS-like styling layer with Rust type-safe APIs to unify appearance and layout across an app.

Core Features & Use Cases

  • Flexbox-based layout helpers for horizontal and vertical arrangements.
  • Styled trait for method chaining to compose visual styles (colors, borders, shadows, size).
  • Size and spacing primitives (px, rems, relative units) for precise, scalable UI.
  • Theme integration and conditional styling to adapt to runtime themes and states.
  • Real-world use cases include building responsive cards, dashboards, and editor-like panels with consistent visuals.

Quick Start

Create a styled GPUI div using the styling primitives to render a card with background color, padding, and rounded corners.

Frequently Asked Questions about gpui-layout-and-style

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

FAQPage Schema
How do I style GPUI components with CSS-like properties in Rust?

You style GPUI components by applying a styled trait for method chaining, using size units like px and rems, color and border helpers, and a flexbox-based layout system to compose consistent visual interfaces.

Can I build responsive dashboards and panels using a flexbox layout in GPUI?

Yes, flexbox-based layout helpers in GPUI support horizontal and vertical arrangements, enabling you to build responsive cards, dashboards, and editor-like panels with consistent visual styling.

What size units and spacing primitives are available for GPUI styling?

GPUI styling uses size and spacing primitives including pixels, rems, and relative units, providing precise, scalable UI layouts across desktop applications through type-safe styling APIs.

How does conditional styling adapt to runtime themes in Rust desktop apps?

Conditional styling integrates with runtime themes to adapt GPUI component appearances dynamically, allowing your desktop application interface to respond to different visual states and theme changes.

Is there a way to unify inconsistent visual styling across a GPUI application?

Yes, introducing a CSS-like styling layer with Rust type-safe APIs unifies appearance and layout across an app, replacing verbose and inconsistent component styling with method-chained visual styles.

Do I need specific dependencies to use CSS-like styling primitives in GPUI?

No external dependencies are required; styling relies on the styled trait, size units, color and border helpers, and a flexbox-based layout system natively to compose styled GPUI components.