Norbi
10/07/2021, 3:48 PMAkif Abasov [JB]
10/07/2021, 4:24 PMNorbi
10/08/2021, 6:01 PMToBeAssignedToSlot({
attr("slot", "nameOfTheSlot")
})
What I could not figure out was how to scope the slots to the given @Composable. I mean first I wanted to achieve that in a given composable context only the currently valid slots could be assigned but I could not find a solution to "scope" them.
What was not obvious first is how to style the shadow DOM, finally I used this (but maybe there is a better solution):
WebComponent({
classes(MyStyleSheet.css {
selector("::part(root)").style {
paddingLeft(0.5.em)
}
})
}) { ... }
One more thing: to follow the code style of the built-in Compose/Web wrappers of the HTML elements, I had to copy this function to my project because it is private: org.jetbrains.compose.web.dom.ElementBuilderImplementation
SyntheticEvent
and SyntheticMouseEvent
have internal
constructors so they cannot be used as the superclass of web components' custom events...Akif Abasov [JB]
10/11/2021, 10:30 AM