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

Support for pseudo classes #18

Closed Leinnan closed 11 months ago

Leinnan commented 1 year ago

Is there any chance for supporting pseudo classes like :hover and :focus for Interaction elements?

Leinnan commented 1 year ago

I did create some code to detect and parse psuedo classes, but I am not quite sure how to approach filtering and so on. There is a patch: https://gist.github.com/Leinnan/9c46bc762fc80773baedb43273fb4e8b

Leinnan commented 1 year ago

I was able to create a repo with a branch that would implement pseudo classes, but for now it is unoptimized- it needs to update all of the nodes after each hover/focus event: https://github.com/Leinnan/bevy_ecss/tree/my_take

TheBeardedQuack commented 1 year ago

Also my take on implementing pseudo-classes (with CSS ordering fix in place).

https://github.com/TheBeardedQuack/tomt_bevycss/releases/tag/0.4.0