afonsolage / bevy_ecss

Bevy crate which uses a subset of CSS to update Bevy ECS components
Apache License 2.0
98 stars 11 forks source link

Fixed css precedence ordering #40

Closed afonsolage closed 9 months ago

afonsolage commented 9 months ago

Fixes #21

Added an weight on Selector which is based on Specificity by Mozilla.

In short terms, we compute a sum based weight for each element on rule, where:

In that way:

Low weight rules are applied first so they got overwritten by high weight rules.