ursus
09/28/2025, 12:47 PMRow modifier horizontalScroll() is not available, how do I make a container of fixed width have its children horizontall scrollable?S.
09/28/2025, 12:56 PMS.
09/28/2025, 12:57 PMModifier.overflow(overflowX = Overflow.Scroll, overflowY = Overflow.Hidden)ursus
09/28/2025, 1:06 PMS.
09/28/2025, 1:11 PMS.
09/28/2025, 1:11 PMgenerally what you want to do for css styling (or js browser functionality) is to search the internet how you would do it with plain css/html/js and try to recreate it in kobweb. often you'll find code snippets which you can paste into https://opletter.github.io/css2kobweb/ to quickly turn css into kobweb codeI sent this to another thread but have a look at the css2kobweb site
ursus
09/28/2025, 1:11 PMverticalScroll() everursus
09/28/2025, 1:12 PMS.
09/28/2025, 1:15 PMursus
09/28/2025, 1:15 PMS.
09/28/2025, 1:16 PMS.
09/28/2025, 1:21 PMSimpleGrid . the css grid layout is quite powerful, this widget provides a very simple version of it without having to mess with grid modifiers yourselfursus
09/28/2025, 1:22 PMS.
09/28/2025, 1:23 PMSimpleGrid is, yeahursus
09/28/2025, 1:30 PMS.
09/28/2025, 1:31 PMursus
09/28/2025, 1:37 PMMaterialTheme.colors.foo shape? (composition locals)S.
09/28/2025, 1:39 PMobject Theme {
val primary = Color.rgb(2,2,2)
val secondary = Color.rgb(1,1,1)
...
}
data class SitePalette(
val primary: Color,
val primaryVariant: Color,
val secondary: Color,
val surface: Color,
val background: Color,
val error: Color,
val shadow: Color,
)
object SitePalettes {
val light = SitePalette(
primary = Theme.primary,
primaryVariant = Theme.secondary,
secondary = Theme.secondary,
surface = Theme.white,
background = Theme.white,
error = Theme.error,
shadow = Theme.black,
)
val dark = SitePalette(
primary = Theme.primary,
primaryVariant = Theme.secondary,
secondary = Theme.secondary,
surface = Theme.darkSurface,
background = Theme.black,
error = Theme.error,
shadow = Theme.white,
)
}
fun ColorMode.toSitePalette() = when (this) {
ColorMode.LIGHT -> SitePalettes.light
ColorMode.DARK -> SitePalettes.dark
}ursus
09/28/2025, 1:41 PMS.
09/28/2025, 1:44 PMCssStyle also exposes a colormode property from which you can then get the according palette. as soon as you depend on colormode or things like :hover you should refactor your modifier chain into a css style (https://kobweb.varabyte.com/docs/concepts/presentation/silk#cssstyle) ( or generally to reuse it in other places)
colormode.toPalette() gives you kobweb/silks color theme and colorMode.toSitePalette() the one from aboveS.
09/28/2025, 1:45 PM@InitSilk
fun initTheme(ctx: InitSilkContext) {
ctx.theme.palettes.apply {
light.apply {
focusOutline = Theme.primary
background = Theme.white
color = Theme.black
link.apply {
default = Theme.primary
visited = Theme.secondary
}
(https://kobweb.varabyte.com/docs/concepts/presentation/silk#initsilk-methods)ursus
09/28/2025, 1:45 PMS.
09/28/2025, 1:47 PMursus
09/28/2025, 1:48 PMColorPallette.primary etcursus
09/28/2025, 1:48 PMS.
09/28/2025, 1:50 PMursus
09/28/2025, 1:51 PMS.
09/28/2025, 1:51 PMS.
09/28/2025, 1:53 PMursus
09/28/2025, 1:55 PMS.
09/28/2025, 2:01 PMTheme.primary in inline modifiers. for more complex styles that change with colorMode or breakpoints it's better to use CssStyle which uses css media queries that are more performant than observing those in js codeDavid Herman
09/30/2025, 6:03 PM