stevdza-san / KotlinBootstrap

Use the official Bootstrap UI components with Kotlin and Compose HTML, to build a frontend on the web.
186 stars 9 forks source link

How to use a general application theme? #16

Closed N7ghtm4r3 closed 4 months ago

N7ghtm4r3 commented 5 months ago

Hi, it is possible use a general application theme like MaterialTheme function for the all application components? For example export the theme from Material Theme Builder or include it as:

<link rel="stylesheet" href="mystyle.css">
stevdza-san commented 5 months ago

Similarly that's how this library is made. You can check the build.gradle file and see where I've declared all those styles. :)

N7ghtm4r3 commented 5 months ago

Thank you, I will check for sure!

N7ghtm4r3 commented 5 months ago

Sorry, I tried to check this build.gradle.kts hoping that was the correct one, but how can I use then after adding to the gradle? For example how can I use the primary color of the general theme in the css for the background color of the NavBar component

stevdza-san commented 5 months ago

You can add those custom css styles in your code, like this for example: https://github.com/stevdza-san/KotlinBootstrap/blob/master/bootstrap/src/jsMain/kotlin/com/stevdza/san/kotlinbs/components/BSButton.kt#L102

N7ghtm4r3 commented 5 months ago

Thank you! I will take a look and implement the theme following your code

N7ghtm4r3 commented 5 months ago

Hi, sorry again, I tried to figure out how to change the color following the code you shared, but in the specific case of the BSNavBar component I'm not figured out how to set a custom color for the background, because the backgroundStyle uses specific colors, is there a way to set a custom color overriding that parameter? Thank you again

stevdza-san commented 5 months ago

I haven't added a support for more customization options.

N7ghtm4r3 commented 5 months ago

Okay I understood, thank you for the reply, but it is planned?