Skip to content

Commit b6b0474

Browse files
authored
Merge pull request #255 from dev-five-git/add-breakpoints
Add breakpoints
2 parents 306ed0f + 3e89601 commit b6b0474

File tree

7 files changed

+13
-5
lines changed

7 files changed

+13
-5
lines changed

.changeset/eleven-insects-read.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@devup-ui/wasm": patch
3+
---
4+
5+
Add default breakpoint

bindings/devup-ui-wasm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ mod tests {
313313
}"##,
314314
)
315315
.unwrap();
316-
assert_eq!(theme.breakpoints, vec![0, 480, 768, 992, 1280]);
316+
assert_eq!(theme.breakpoints, vec![0, 480, 768, 992, 1280, 1600]);
317317
assert_debug_snapshot!(theme.to_css());
318318
}
319319
{

bindings/devup-ui-wasm/src/snapshots/devup_ui_wasm__tests__deserialize_theme-2.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Theme {
2121
768,
2222
992,
2323
1280,
24+
1600,
2425
],
2526
typography: {
2627
"default": Typographies(

bindings/devup-ui-wasm/src/snapshots/devup_ui_wasm__tests__deserialize_theme-3.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Theme {
1010
768,
1111
992,
1212
1280,
13+
1600,
1314
],
1415
typography: {
1516
"body": Typographies(

libs/sheet/src/snapshots/sheet__tests__deserialize.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ StyleSheet {
2727
768,
2828
992,
2929
1280,
30+
1600,
3031
],
3132
typography: {},
3233
},

libs/sheet/src/snapshots/sheet__tests__wrong_breakpoint.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: libs/sheet/src/lib.rs
33
expression: sheet.create_css()
44
---
5-
"@media(min-width:1280px){.test{margin-left:40px;margin-right:40px}}"
5+
"@media(min-width:1600px){.test{margin-left:40px;margin-right:40px}}"

libs/sheet/src/theme.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ pub struct Theme {
9696
}
9797

9898
fn default_breakpoints() -> Vec<u16> {
99-
vec![0, 480, 768, 992, 1280]
99+
vec![0, 480, 768, 992, 1280, 1600]
100100
}
101101

102102
impl Default for Theme {
103103
fn default() -> Self {
104104
Self {
105105
colors: Default::default(),
106-
breakpoints: vec![0, 480, 768, 992, 1280],
106+
breakpoints: default_breakpoints(),
107107
typography: BTreeMap::new(),
108108
}
109109
}
@@ -424,7 +424,7 @@ mod tests {
424424
fn update_breakpoints() {
425425
let mut theme = Theme::default();
426426
theme.update_breakpoints(vec![0, 480, 768, 992, 1280]);
427-
assert_eq!(theme.breakpoints, vec![0, 480, 768, 992, 1280]);
427+
assert_eq!(theme.breakpoints, vec![0, 480, 768, 992, 1280, 1600]);
428428
theme.update_breakpoints(vec![0, 480, 768, 992, 1280, 1600]);
429429
assert_eq!(theme.breakpoints, vec![0, 480, 768, 992, 1280, 1600]);
430430
theme.update_breakpoints(vec![0, 480, 768, 992, 1280, 1600, 1920]);

0 commit comments

Comments
 (0)