create another button style
This commit is contained in:
parent
9bf4d6124c
commit
9aeecc7dee
@ -6,7 +6,8 @@ pub enum ButtonStyle {
|
|||||||
Secondary,
|
Secondary,
|
||||||
Success,
|
Success,
|
||||||
Danger,
|
Danger,
|
||||||
Warning
|
Warning,
|
||||||
|
Cyberpunk
|
||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
@ -37,6 +38,9 @@ pub fn Button(
|
|||||||
},
|
},
|
||||||
ButtonStyle::Warning => {
|
ButtonStyle::Warning => {
|
||||||
stylestring = "bg-yellow-500 hover:bg-yellow-700 text-black font-semibold py-2 px-4 rounded";
|
stylestring = "bg-yellow-500 hover:bg-yellow-700 text-black font-semibold py-2 px-4 rounded";
|
||||||
|
},
|
||||||
|
ButtonStyle::Cyberpunk => {
|
||||||
|
stylestring = "bg-[#0a0c1b] hover:bg-[#171d3a] text-white font-bold py-2 px-4 rounded shadow-lg transition duration-300 ease-in-out transform hover:scale-105";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logging::log!("{}", stylestring);
|
logging::log!("{}", stylestring);
|
||||||
|
|||||||
@ -5,6 +5,7 @@ use leptos_router::{
|
|||||||
StaticSegment,
|
StaticSegment,
|
||||||
};
|
};
|
||||||
use leptos_components::components::buttons::Button;
|
use leptos_components::components::buttons::Button;
|
||||||
|
use leptos_components::components::buttons::ButtonStyle;
|
||||||
|
|
||||||
pub fn shell(options: LeptosOptions) -> impl IntoView {
|
pub fn shell(options: LeptosOptions) -> impl IntoView {
|
||||||
view! {
|
view! {
|
||||||
@ -58,6 +59,6 @@ fn HomePage() -> impl IntoView {
|
|||||||
view! {
|
view! {
|
||||||
<h1>"Welcome to Leptos!"</h1>
|
<h1>"Welcome to Leptos!"</h1>
|
||||||
<button on:click=on_click>"Click Me: " {move || count.get()}</button>
|
<button on:click=on_click>"Click Me: " {move || count.get()}</button>
|
||||||
<Button on:click=on_click>"Click Me: " {move || count.get()}</Button>
|
<Button style=ButtonStyle::Cyberpunk on:click=on_click>"Click Me: " {move || count.get()}</Button>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user