Chris
08/03/2023, 10:05 AMModifier
work on Compose for HTML, but I keep getting the error: Unresolved reference: Modifier
. Am I missing imports and/or a Gradle implementation?Big Chungus
08/03/2023, 10:14 AMChris
08/03/2023, 10:30 AMModifier
with .then()
and other standard functions – even if those modifiers don’t do anything to the HTML. Is there any way to import the Modifier
type, at all, in to Compose for HTML?
Or will I need to create a shim, perhaps?Arjan van Wieringen
08/03/2023, 10:42 AMOleksandr Karpovich [JB]
08/03/2023, 10:45 AMcompose.ui
if you really need it.
I assume you want a basic Modifier interface that does nothing at all by default. But it should allow to build your own modifiers if neededDavid Herman
08/03/2023, 11:37 PMModifier
for Compose HTML. It's technically not the same one as Compose Multiplatform's Modifier
class (it's a custom fork that is designed to work with CSS), but if you're creating a standalone site using Compose HTML, it shouldn't matter. I also wrote a bit about the framework here, including a Modifier
section: https://bitspittle.dev/blog/2022/kotlinsiteDavid Herman
08/03/2023, 11:41 PMModifier
implementation into your own codebase if it helps: https://github.com/varabyte/kobweb/blob/main/frontend/kobweb-compose/src/jsMain/kotlin/com/varabyte/kobweb/compose/ui/Modifier.ktChris
08/04/2023, 6:08 AMModifier
class and use that as a foundation for this custom layout system, if that’s okay? (I’m actually only using HTML as an intermediate data layer, so no need for CSS… If I could just get a tree graph out of Kotlin/JS without going through HMTL at all, I would!)
And thanks, also, @Oleksandr Karpovich [JB]. implementation(compose.ui)
and import androidx.compose.ui.Modifier
worked, once I added org.jetbrains.compose.experimental.jscanvas.enabled=true
. I can’t help but feel I’m venturing onto relatively untested ground with this combination, though 😅David Herman
08/04/2023, 10:04 PMDavid Herman
08/04/2023, 10:05 PMModifier
in my code as well, in case it helps. https://github.com/varabyte/kobweb/blob/main/frontend/kobweb-compose/src/jsMain/kotlin/com/varabyte/kobweb/compose/ui/WebModifier.ktDavid Herman
08/04/2023, 10:06 PMChris
08/05/2023, 9:19 PM