Skip to content

Commit

Permalink
improved media query code using the new Kobweb breakpoint ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
Luki120 committed Dec 2, 2024
1 parent 80e80f8 commit dc82111
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
8 changes: 1 addition & 7 deletions site/src/jsMain/kotlin/me/luki/website/composables/Footer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
}
Expand Down
7 changes: 2 additions & 5 deletions site/src/jsMain/kotlin/me/luki/website/composables/Header.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit dc82111

Please sign in to comment.