Skip to content

Commit

Permalink
feat: add background_color field to Label/Column/Row/Grid (#90
Browse files Browse the repository at this point in the history
)
  • Loading branch information
shamilsan authored May 11, 2024
1 parent 1b767fe commit efb2cb5
Show file tree
Hide file tree
Showing 16 changed files with 219 additions and 156 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ prepare:
@rustup target add wasm32-unknown-unknown
@cargo install wasm-bindgen-cli

pre-commit: fmt linter test
pre-commit: fmt fmt-leptos linter test

serve: examples
@cd dist && python3 -m http.server 8000
Expand Down
1 change: 1 addition & 0 deletions examples/blur.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use leptos::*;
use lerni::*;

/// Blur example.
#[component]
pub fn Blur() -> impl IntoView {
let (blur, set_blur) = create_signal(false);
Expand Down
1 change: 1 addition & 0 deletions examples/buttons.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use leptos::*;
use lerni::*;

/// Buttons example.
#[component]
pub fn Buttons() -> impl IntoView {
let (counter, set_counter) = create_signal(0);
Expand Down
5 changes: 4 additions & 1 deletion examples/grid.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use leptos::*;
use lerni::*;

/// Grid layout example.
#[component]
pub fn GridExample() -> impl IntoView {
view! {
Expand Down Expand Up @@ -31,7 +32,9 @@ pub fn GridExample() -> impl IntoView {
<Grid cols=4 rows=2 border_width=4 spacing=20>
<Label valign=VAlign::Top>"9"</Label>
<Label valign=VAlign::Bottom>"10"</Label>
<Label>11</Label>
<Label color=Color::White background_color=Color::Red>
"11"
</Label>
<Button
align=Align::Fill
valign=VAlign::Fill
Expand Down
2 changes: 2 additions & 0 deletions examples/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use leptos::{ev::keydown, *};
use leptos_use::use_event_listener;
use lerni::*;

/// Hello world example.
#[component]
pub fn HelloWorld() -> impl IntoView {
view! {
Expand All @@ -17,6 +18,7 @@ pub fn HelloWorld() -> impl IntoView {
}
}

/// Counter component.
#[component]
pub fn Counter() -> impl IntoView {
let (counter, set_counter) = create_signal(0);
Expand Down
15 changes: 13 additions & 2 deletions examples/rows_cols.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
use leptos::*;
use lerni::*;

/// Rows and columns layout example.
#[component]
pub fn RowsCols() -> impl IntoView {
view! {
<Slide>
<Row border_width=4 stretch=[1, 1, 4, 1, 1] padding=20>
<Row
border_width=4
stretch=[1, 1, 4, 1, 1]
padding=20
background_color=Color::MistyRose
>
<Label>"1"</Label>
<Button align=Align::Fill valign=VAlign::Fill on_click=|_| ()>
"2"
</Button>
<Label bold=true>"3"</Label>
<Column border_width=4 stretch=[1, 2, 3, 4] spacing=20>
<Column
border_width=4
stretch=[1, 2, 3, 4]
spacing=20
background_color=Color::Honeydew
>
<Label>"4"</Label>
<Label>"5"</Label>
<Button align=Align::Fill valign=VAlign::Fill on_click=|_| ()>
Expand Down
1 change: 1 addition & 0 deletions examples/stack.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use leptos::*;
use lerni::*;

/// Stack example.
#[component]
pub fn StackExample() -> impl IntoView {
view! {
Expand Down
1 change: 1 addition & 0 deletions examples/svg.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use leptos::*;
use lerni::*;

/// SVG example.
#[component]
pub fn SvgExample() -> impl IntoView {
view! {
Expand Down
1 change: 1 addition & 0 deletions examples/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use leptos::{ev::keydown, *};
use leptos_use::use_event_listener;
use lerni::*;

/// Text example.
#[component]
pub fn TextExample() -> impl IntoView {
let word_count1 = create_rw_signal(0);
Expand Down
Loading

0 comments on commit efb2cb5

Please sign in to comment.