afonsolage / bevy_ecss

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

Fixed css precedence ordering #40

Closed afonsolage closed 1 year ago

afonsolage commented 1 year 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.