Replies: 4 comments 5 replies
-
Please read https://github.com/varabyte/kobweb?tab=readme-ov-file#color-mode-aware and maybe also https://github.com/varabyte/kobweb?tab=readme-ov-file#style-variables I think the way you're trying to force change the look and feel of widget colors isn't quite right? |
Beta Was this translation helpful? Give feedback.
-
I have read docs and I have tried to code as shown in the image below.
Unfortunately it is not working as expected. It is showing the link's
default blue color.
val NavigationItemStyle = CssStyle {
base {
Modifier.styleModifier {
property("--bs-link-color", Theme.Secondary.rgb)
}.color(Theme.Secondary.rgb)
.transition(Transition.of(property = "color", duration = 200.ms))
}
hover {
Modifier.styleModifier {
property("--bs-link-hover-color", Theme.Primary.rgb)
}.color(Theme.Primary.rgb)
}
}
Link(
modifier = NavigationItemStyle.toModifier().padding(15.px).fontFamily(FONT_FAMILY)
.fontSize(18.px).fontWeight(
FontWeight.Normal
).textDecorationLine(TextDecorationLine.None),
path = section.path,
text = section.title
)
It would be great if you can help me guide me if I am doing anything
wrong, It will be a great help for me.
Thanks
Harsh Patel
…On Fri, 2 Aug 2024 at 10:16, David Herman ***@***.***> wrote:
Please read
https://github.com/varabyte/kobweb?tab=readme-ov-file#color-mode-aware
and maybe also
https://github.com/varabyte/kobweb?tab=readme-ov-file#style-variables
I think the way you're trying to force change the look and feel of widget
colors isn't quite right?
—
Reply to this email directly, view it on GitHub
<#582 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMW5CYU3GPPKG366WBIJXF3ZPMFJRAVCNFSM6AAAAABL3X4GCWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMRRHEZTKNY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Let me explain this to you. The code which I have shared to you is working fine previously but after updating kobweb version it is not working. If I downgrade version then my code shows deprication warnings. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your guidance. I have found one workaround which works for me. Closing this for further discussion. |
Beta Was this translation helpful? Give feedback.
-
I am developing Static website with KOBWEB framework. Navigation is an essential part of each and every website. I am also doing something relevant. I am using Link Composable provided by KOBWEB framework with some styling. it is functioning as expected but for UI/UX my style is not attached to the component properly.
Here is a component I have used in my page :
Link( modifier = NavigationItemStyle.toModifier().padding(15.px).fontFamily(FONT_FAMILY) .fontSize(18.px).fontWeight( FontWeight.Normal ).textDecorationLine(TextDecorationLine.None), path = section.path, text = section.title )
Style which I have used is as below :
val NavigationItemStyle = CssStyle { base { Modifier.styleModifier { property("--bs-link-color", Theme.Secondary.rgb) } .color(Theme.Secondary.rgb) .transition(Transition.of(property = "color", duration = 200.ms)) } hover { Modifier.styleModifier { property("--bs-link-hover-color", Theme.Primary.rgb) } .color(Theme.Primary.rgb) } }
When I am trying to run this code it is not applying my style instead it shows the default blue color of links.
My question is, Am I doing anything wrong or this is the issue in the component itself?
Beta Was this translation helpful? Give feedback.
All reactions