Skip to content

Commit

Permalink
Use Arrangement.spacedBy from Kobweb
Browse files Browse the repository at this point in the history
See varabyte/kobweb#541 for its introduction into Kobweb.
  • Loading branch information
ShreckYe committed Dec 9, 2024
1 parent 8978aef commit 53ff09f
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.huanshankeji.compose.ui.unit.toPx
import com.varabyte.kobweb.compose.foundation.layout.Arrangement
import com.varabyte.kobweb.compose.ui.styleModifier
import org.jetbrains.compose.web.css.StyleScope
import org.jetbrains.compose.web.css.gap
import com.varabyte.kobweb.compose.foundation.layout.Arrangement as PlatformArrangement

@Immutable
Expand Down Expand Up @@ -73,11 +72,7 @@ actual object Arrangement {

@Stable
actual fun spacedBy(space: Dp): HorizontalOrVertical =
object : HorizontalOrVertical.FromStyleImpl() {
override fun StyleScope.styles() {
gap(space.toPx())
}
}
HorizontalOrVertical.Impl(PlatformArrangement.spacedBy(space.toPx()))
}

fun PlatformModifier.stylesFrom(arrangement: CommonArrangement) =
Expand Down

0 comments on commit 53ff09f

Please sign in to comment.