Any examples of CSS selectors as Prolog queries?

For most HTML beyond a simple page CSS is used. CSS uses selectors for modifying parts of the DOM such as styles. CSS selectors also use a minimal approach to the operators, e.g. *, ., ,, >, ~, etc.

I can never remember all of the various selectors and more importantly how to combine them and use them when cascading.

Has someone done a set of Prolog predicates that emulate CSS selectors?

Hopefully seeing such would give me a mental map from a place of understanding into a place of confusion.


Also of consideration and related to CSS is Sass.

1 Like