Is there a way to query semantic properties for an...
# compose
n
Is there a way to query semantic properties for an element from a modifier on the element? I was hoping to use custom semantic properties as the basis for a style system.
I suppose using Ambients is a better idea
z
It’s definitely more idiomatic to use ambients for styles.
Not sure exactly what you mean by “element” either – compose doesn’t have any real concept of a “view” or anything that you can actually get a reference to. When you pass a modifier to a composable, you can’t know how the composable is going to use it. It might wrap all its children in a layout node that uses the modifier, or emit multiple layout nodes and only apply a modifier to one of them, or pass the modifier down to an indirect child layout node.