Norbi
02/20/2024, 5:08 PMModifier.width(Breakpoint.LG.toWidth())
I currently use the following non-type-safe solution:
styleModifier {
property("width", Breakpoint.LG.toWidth())
}
David Herman
02/20/2024, 6:20 PMModifier.width(Breakpoint.LG.toPx() as CSSpxValue)
Thanks to your comment, I'll be updating toPx
to return CSSpxValue in the next version of Kobweb (at which point you could remove the cast)
Alternately, you can tell the compiler that you're smarter than it is:
Modifier.width(Breakpoint.LG.toWidth().unsafeCast<CSSLengthNumericValue>())
which is now also something I'm considering doing in the next version of Kobweb as well.David Herman
02/20/2024, 6:25 PMunsafeCast
one, but I'm testing right now if that will actually work)Norbi
02/20/2024, 7:00 PMsuggest the secondIt works for me, thanks :)oneunsafeCast
David Herman
02/20/2024, 7:00 PMDavid Herman
02/20/2024, 7:00 PMDavid Herman
02/20/2024, 7:01 PMDavid Herman
02/20/2024, 7:01 PMDavid Herman
02/20/2024, 7:02 PMDavid Herman
02/20/2024, 7:09 PM