From cde51a0a417164a28e830e57cccbbc354e888bbe Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 18 Jul 2025 13:51:11 +0900 Subject: [PATCH 1/3] Add breakpoints --- libs/sheet/src/snapshots/sheet__tests__deserialize.snap | 1 + .../sheet/src/snapshots/sheet__tests__wrong_breakpoint.snap | 2 +- libs/sheet/src/theme.rs | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/sheet/src/snapshots/sheet__tests__deserialize.snap b/libs/sheet/src/snapshots/sheet__tests__deserialize.snap index 31e307e1..b63a9ead 100644 --- a/libs/sheet/src/snapshots/sheet__tests__deserialize.snap +++ b/libs/sheet/src/snapshots/sheet__tests__deserialize.snap @@ -27,6 +27,7 @@ StyleSheet { 768, 992, 1280, + 1600, ], typography: {}, }, diff --git a/libs/sheet/src/snapshots/sheet__tests__wrong_breakpoint.snap b/libs/sheet/src/snapshots/sheet__tests__wrong_breakpoint.snap index b821c7d3..e3a771f3 100644 --- a/libs/sheet/src/snapshots/sheet__tests__wrong_breakpoint.snap +++ b/libs/sheet/src/snapshots/sheet__tests__wrong_breakpoint.snap @@ -2,4 +2,4 @@ source: libs/sheet/src/lib.rs expression: sheet.create_css() --- -"@media(min-width:1280px){.test{margin-left:40px;margin-right:40px}}" +"@media(min-width:1600px){.test{margin-left:40px;margin-right:40px}}" diff --git a/libs/sheet/src/theme.rs b/libs/sheet/src/theme.rs index 4d4c59fd..6a1878e1 100644 --- a/libs/sheet/src/theme.rs +++ b/libs/sheet/src/theme.rs @@ -96,14 +96,14 @@ pub struct Theme { } fn default_breakpoints() -> Vec { - vec![0, 480, 768, 992, 1280] + vec![0, 480, 768, 992, 1280, 1600] } impl Default for Theme { fn default() -> Self { Self { colors: Default::default(), - breakpoints: vec![0, 480, 768, 992, 1280], + breakpoints: default_breakpoints(), typography: BTreeMap::new(), } } @@ -424,7 +424,7 @@ mod tests { fn update_breakpoints() { let mut theme = Theme::default(); theme.update_breakpoints(vec![0, 480, 768, 992, 1280]); - assert_eq!(theme.breakpoints, vec![0, 480, 768, 992, 1280]); + assert_eq!(theme.breakpoints, vec![0, 480, 768, 992, 1280, 1600]); theme.update_breakpoints(vec![0, 480, 768, 992, 1280, 1600]); assert_eq!(theme.breakpoints, vec![0, 480, 768, 992, 1280, 1600]); theme.update_breakpoints(vec![0, 480, 768, 992, 1280, 1600, 1920]); From 43729f0eac08a65b82fe96436c4681f8dea3a5e2 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 18 Jul 2025 13:53:20 +0900 Subject: [PATCH 2/3] Add breakpoints --- .changeset/eleven-insects-read.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/eleven-insects-read.md diff --git a/.changeset/eleven-insects-read.md b/.changeset/eleven-insects-read.md new file mode 100644 index 00000000..06e38b97 --- /dev/null +++ b/.changeset/eleven-insects-read.md @@ -0,0 +1,5 @@ +--- +"@devup-ui/wasm": patch +--- + +Add default breakpoint From 3e89601da8a8cf0b1e4d5ddf681a130790b95c7b Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 18 Jul 2025 14:00:29 +0900 Subject: [PATCH 3/3] Add breakpoints --- bindings/devup-ui-wasm/src/lib.rs | 2 +- .../snapshots/devup_ui_wasm__tests__deserialize_theme-2.snap | 1 + .../snapshots/devup_ui_wasm__tests__deserialize_theme-3.snap | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bindings/devup-ui-wasm/src/lib.rs b/bindings/devup-ui-wasm/src/lib.rs index 8bfde35a..01281779 100644 --- a/bindings/devup-ui-wasm/src/lib.rs +++ b/bindings/devup-ui-wasm/src/lib.rs @@ -313,7 +313,7 @@ mod tests { }"##, ) .unwrap(); - assert_eq!(theme.breakpoints, vec![0, 480, 768, 992, 1280]); + assert_eq!(theme.breakpoints, vec![0, 480, 768, 992, 1280, 1600]); assert_debug_snapshot!(theme.to_css()); } { diff --git a/bindings/devup-ui-wasm/src/snapshots/devup_ui_wasm__tests__deserialize_theme-2.snap b/bindings/devup-ui-wasm/src/snapshots/devup_ui_wasm__tests__deserialize_theme-2.snap index c4e92f52..ed192426 100644 --- a/bindings/devup-ui-wasm/src/snapshots/devup_ui_wasm__tests__deserialize_theme-2.snap +++ b/bindings/devup-ui-wasm/src/snapshots/devup_ui_wasm__tests__deserialize_theme-2.snap @@ -21,6 +21,7 @@ Theme { 768, 992, 1280, + 1600, ], typography: { "default": Typographies( diff --git a/bindings/devup-ui-wasm/src/snapshots/devup_ui_wasm__tests__deserialize_theme-3.snap b/bindings/devup-ui-wasm/src/snapshots/devup_ui_wasm__tests__deserialize_theme-3.snap index 15bedb5d..853802a3 100644 --- a/bindings/devup-ui-wasm/src/snapshots/devup_ui_wasm__tests__deserialize_theme-3.snap +++ b/bindings/devup-ui-wasm/src/snapshots/devup_ui_wasm__tests__deserialize_theme-3.snap @@ -10,6 +10,7 @@ Theme { 768, 992, 1280, + 1600, ], typography: { "body": Typographies(