Has anyone tried creating a site/browser extension...
# javascript
a
Has anyone tried creating a site/browser extension with material components web? They have a react component in js, though I'm curious if there is a kotlin version anywhere
n
There are Material components available in Materialize ( https://materializecss.com/badges.html ), which is just HTML that can be handled by a Kotlin JS view lib/framework (eg KotlinX HTML - https://github.com/Kotlin/kotlinx.html ; KVision - https://github.com/rjaros/kvision ). Would require some extra functions to be defined for generating the required HTML.
a
I’m aware of materialize, but I wanted to know if there were other things oriented to the official mdc. With materialize as well, there are no kotlin interfaces, so I think any type safety would have to be defined manually. An extension of my question would be what nice approaches there are to adding kotlin interfaces to ui libraries that don’t support it. I will take a look at kvision and see what that introduces.
g
Materialize is just a css library. So you could use the kotlin react wrapper or kotlinx-html and just add the classes to your elements and components. Its pretty much the same thing as if you were doing it in html, you just add the css classes to the elements
if you want type safe css, check out kotlin-css and kotlin-styled here: https://github.com/JetBrains/kotlin-wrappers Though in my opinion type safe css is not every useful and I prefer keeping my stylesheets separate and use sass as a preprocessor
a
Materialize depends on jQuery for a lot of their interactions, and as a result isn't super great with react and other frameworks. CSS wise I'm fine with using sass, and I think MDC has that as well
g
Actually I decided to give kotlin-styled another try, and it actually is really nice. Having single file components is pretty great in my Kotlin React project