Type(?) selection in Bike 2 extensions

I’m having fun making an editor style — but I also have some issues with selection. I also had this in the previous implementation.

What I’m trying now is to style .unordered. However, here are some things I’m struggling with:

  1. Could I style “all parents that aren’t .unordered” somehow?
  2. How can I style “.unordered that are also parents”? I’ve tried row(.unordered and collapsed() = true, row(.unordered and collapsed() = true, row(.unordered and parent() = true and a bunch of variants. :sweat_smile: I’ve also tried to move things in different layers.

Now I’ve reduced it to this test:

row(.unordered and parent = true, (context, row) => {row.text.color = Color.systemRed()})

And I try to move things around to see if they become red, heh.

I tried to use the Outline Explorer to help debugging, but it doesn’t help as it doesn’t show if things are parents, collapsed and more.

I’m not sure if this is what you are looking for, but maybe:

row(`.@type != unordered and parent() = true`, (context, row) => {
  row.text.color = Color.systemBlue()
})
row(`.@type = unordered and parent() = true`, (context, row) => {
  row.text.color = Color.systemRed()
})
2 Likes