From dc821112d880253c9088de5cd2681c1e397db7b1 Mon Sep 17 00:00:00 2001 From: luki120 Date: Mon, 2 Dec 2024 00:30:13 -0300 Subject: [PATCH] improved media query code using the new Kobweb breakpoint ranges --- .../jsMain/kotlin/me/luki/website/composables/Footer.kt | 8 +------- .../jsMain/kotlin/me/luki/website/composables/Header.kt | 7 ++----- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/site/src/jsMain/kotlin/me/luki/website/composables/Footer.kt b/site/src/jsMain/kotlin/me/luki/website/composables/Footer.kt index 26f3145..7d5a4a3 100644 --- a/site/src/jsMain/kotlin/me/luki/website/composables/Footer.kt +++ b/site/src/jsMain/kotlin/me/luki/website/composables/Footer.kt @@ -21,8 +21,6 @@ import com.varabyte.kobweb.silk.components.navigation.LinkStyle import com.varabyte.kobweb.silk.components.text.SpanText import com.varabyte.kobweb.silk.style.addVariant import com.varabyte.kobweb.silk.style.breakpoint.Breakpoint -import com.varabyte.kobweb.silk.style.plus -import com.varabyte.kobweb.silk.style.selectors.hover import com.varabyte.kobweb.silk.style.toModifier import com.varabyte.kobweb.silk.theme.colors.ColorMode import me.luki.website.styles.SocialButtonStyle @@ -42,11 +40,7 @@ val FooterLinkVariant = LinkStyle.addVariant { Modifier.color(CustomColors.Purple) } - (Breakpoint.MD + hover) { - Modifier.textDecorationLine(TextDecorationLine.Underline) - } - - Breakpoint.ZERO { + (Breakpoint.ZERO until Breakpoint.MD) { Modifier.textDecorationLine(TextDecorationLine.None) } } diff --git a/site/src/jsMain/kotlin/me/luki/website/composables/Header.kt b/site/src/jsMain/kotlin/me/luki/website/composables/Header.kt index 3b048b7..16c5420 100644 --- a/site/src/jsMain/kotlin/me/luki/website/composables/Header.kt +++ b/site/src/jsMain/kotlin/me/luki/website/composables/Header.kt @@ -34,6 +34,7 @@ import com.varabyte.kobweb.silk.style.breakpoint.displayUntil import com.varabyte.kobweb.silk.style.plus import com.varabyte.kobweb.silk.style.selectors.link import com.varabyte.kobweb.silk.style.toModifier +import com.varabyte.kobweb.silk.style.until import com.varabyte.kobweb.silk.style.vars.color.ColorVar import com.varabyte.kobweb.silk.theme.colors.ColorMode import kotlinx.browser.localStorage @@ -66,14 +67,10 @@ val NavigationBarLinkVariant = LinkStyle.addVariant { Modifier.textDecorationLine(TextDecorationLine.None) } - (Breakpoint.ZERO + link) { + until(Breakpoint.MD) { Modifier.color(ColorVar.value()) } - (Breakpoint.MD + link) { - Modifier.color(CustomColors.Purple) - } - Breakpoint.MD { Modifier .border(