MCPcopy Index your code
hub / github.com/afonsolage/bevy_ecss

github.com/afonsolage/bevy_ecss @0.7.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.7.0 ↗ · + Follow
152 symbols 279 edges 15 files 52 documented · 34% updated 23mo ago★ 10112 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Bevy

MIT/Apache 2.0 Realease Doc Rust Crate Bevy tracking

Bevy ECSS

What is Bevy ECSS?

Bevy ECSS is a crate which allows the usage of a subset of CSS to interact with bevy_ecs. It's mainly aimed to apply styling on bevy_ui but it can be used by any component by implementing custom properties.

Why the name?

Just because Bevy ECS + CSS is a perfect fit!

Docs site

Reference guide, examples and more available here: docs

Usage

To use Bevy ECSS just add a StyleSheet with a loaded css file to any entity and all style sheet rules will be applied to the entity and all its descendants (children of children of children and so on).

use bevy::prelude::*;
use bevy_ecss::prelude::*;

fn setup_awesome_ui(root: Entity, mut commands: Commands, asset_server: Res<AssetServer>) {
    commands
        .entity(root)
        .insert(StyleSheet::new(asset_server.load("sheets/awesome.css")));
}

That's it, now your UI will indeed look awesome!

Bevy support table

bevy bevy_ecss
0.8 0.1
0.9 0.2
0.10 0.3
0.11 0.4
0.12 0.5
0.12 0.6
0.13 0.7

Contributing

Got some idea, feedback, question or found any bug? Feel free to open an issue at any time!

License

Bevy ECSS is dual-licensed under either:

This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.

Extension points exported contracts — how you extend this code

Property (Interface)
Determines how a property should interact and modify the [ecs world](`bevy::prelude::World`). Each implementation of th [9 …
src/property/mod.rs
MatchSelectorElement (Interface)
Convenience trait which matches matches a component against a named element selector. [2 implementers]
src/component.rs
RegisterComponentSelector (Interface)
Utility trait which adds the [`register_component_selector`](RegisterComponentSelector::register_component_selector) fun [1 …
src/lib.rs
ComponentFilter (Interface)
Utility trait which helps to deal with dynamic components Each trait is implemented for a [`SystemState `] with a sing [1 …
src/system.rs
RegisterProperty (Interface)
Utility trait which adds the [`register_property`](RegisterProperty::register_property) function on [`App`](bevy::prelud [1 …
src/lib.rs

Core symbols most depended-on inside this repo

iter
called by 26
src/stylesheet.rs
load
called by 22
src/stylesheet.rs
get_parent_tree
called by 9
src/selector.rs
filter
called by 7
src/system.rs
set
called by 6
src/component.rs
handles
called by 4
src/component.rs
matches
called by 3
src/component.rs
string
called by 3
src/property/mod.rs

Shape

Method 59
Function 48
Class 32
Enum 8
Interface 5

Languages

Rust100%

Modules by API surface

src/system.rs26 symbols
src/parser.rs22 symbols
src/property/mod.rs21 symbols
src/component.rs15 symbols
src/lib.rs13 symbols
src/selector.rs12 symbols
src/stylesheet.rs11 symbols
src/property/impls.rs11 symbols
examples/alpha.rs6 symbols
examples/theme.rs5 symbols
src/property/colors.rs2 symbols
examples/stress_test.rs2 symbols

For agents

$ claude mcp add bevy_ecss \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page