Skip to content

Commit 66c020f

Browse files
authored
Merge pull request #6 from brunoti/feature/4/add_new_properties
add properties
2 parents 7944d5b + 9636756 commit 66c020f

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

e2e/stylesheet_render/src/stylesheet_render.gleam

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,15 @@ fn color_class(model: Model) {
5959
|> sketch.to_lustre()
6060
}
6161

62+
fn button_class() {
63+
sketch.class([sketch.cursor("crosshair"), sketch.font_size_("14px")])
64+
|> sketch.to_lustre()
65+
}
66+
6267
fn view(model: Model) {
6368
html.div([main_class()], [
64-
html.button([event.on_click(Decrement)], [html.text("Decrement")]),
69+
html.button([event.on_click(Decrement), button_class()], [html.text("Decrement")]),
6570
html.div([color_class(model)], [html.text(int.to_string(model))]),
66-
html.button([event.on_click(Increment)], [html.text("Increment")]),
71+
html.button([event.on_click(Increment), button_class()], [html.text("Increment")]),
6772
])
6873
}

src/sketch.gleam

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
//// - [`font_family`](#font_family)
3737
//// - [`font_style`](#font_style)
3838
//// - [`font_size`](#font_size)
39+
//// - [`font_size_`](#font_size_)
3940
//// - [`font_weight`](#font_weight)
4041
//// - [`letter_spacing`](#letter_spacing)
4142
//// - [`line_break`](#line_break)
@@ -159,6 +160,7 @@
159160
//// - [`margin_bottom`](#margin_bottom)
160161
//// - [`margin_right`](#margin_right)
161162
//// - [`margin_left`](#margin_left)
163+
//// - [`cursor`](#cursor)
162164
//// - [`property`](#property)
163165
////
164166
//// - Pseudo-selectors
@@ -443,6 +445,10 @@ pub fn font_size(font_size: Size) {
443445
Property("font-size", size.to_string(font_size), False)
444446
}
445447

448+
pub fn font_size_(font_size: String) {
449+
Property("font-size", font_size, False)
450+
}
451+
446452
pub fn font_weight(font_weight: String) {
447453
Property("font-weight", font_weight, False)
448454
}
@@ -935,6 +941,10 @@ pub fn margin_left(margin: Size) {
935941
Property("margin-left", size.to_string(margin), False)
936942
}
937943

944+
pub fn cursor(cursor: String) {
945+
Property("cursor", cursor, False)
946+
}
947+
938948
pub fn property(field: String, content: String) {
939949
Property(field, content, False)
940950
}

0 commit comments

Comments
 (0)