Skip to content

Commit cde51a0

Browse files
committed
Add breakpoints
1 parent 306ed0f commit cde51a0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

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)