Skip to content
BX-TeamPublic

About

BX Team's design system for gpui, built on GPUI Kit

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

moonglass

BX Team's design system for gpui, built on GPUI Kit. It is the look shared by Riven and Nyx.

  • theme: a twelve-color Palette, six built-in themes (Graphite, Night, Moss, Ember, Day, Paper), app-registered themes, light/dark/system mode with a 260 ms fade.
  • TitleBar and resize edges for windows that draw their own frame.
  • Components: Button, Tabs, Switch, TextField, TextArea, Dropdown, ActionMenu, context menus, Modal, Section + setting_row, nav_row, placeholder, copy_button, toasts.
  • code: a small lexer for TOML/JSON/YAML and a themed CodeEditor.
  • motion: hover, color and position transitions, entrances, a gliding selection highlight; all respect reduced motion.
[dependencies]
moonglass = "0.1"

moonglass re-exports gpui_kit; depend on gpui through it so the versions cannot drift.

use moonglass::gpui_kit::*;

gpui_kit::application()
    .with_assets(moonglass::Assets)
    .run(|cx| {
        gpui_kit::init(cx);
        moonglass::init(cx);
        let options = WindowOptions {
            app_id: Some("my-app".into()),
            ..moonglass::chrome::window_options()
        };
        // The root view calls `moonglass::theme::tick(window, cx)` first thing in `render`.
        gpui_kit::open_window(options, cx, |window, cx| MyApp::view(window, cx)).unwrap();
    });

An app with its own assets chains them: try its own source, then moonglass::Assets.

Developing next to an app

Point the app at a local checkout without committing it, in the app's .cargo/config.toml:

[patch.crates-io]
moonglass = { path = "../moonglass" }

License

GPL-3.0-or-later.

About

BX Team's design system for gpui, built on GPUI Kit

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Used by

Contributors

Languages