Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

take the smallest breakpoint as default when creating a new project

Oleg Isonenab9835b30d37
diff --git a/app/shared/db/tree.server.ts b/app/shared/db/tree.server.ts
index 22aa2b523a..7e33fda3f9 100644
--- a/app/shared/db/tree.server.ts
+++ b/app/shared/db/tree.server.ts
@@ -7,11 +7,11 @@ import {
import { applyPatches, type Patch } from "immer";
import { prisma } from "./prisma.server";
import { createInstance } from "~/shared/tree-utils";
+import { sort } from "~/shared/breakpoints";
export const createRootInstance = (breakpoints: Array<Breakpoint>) => {
- const defaultBreakpoint = breakpoints.find(
- (breakpoint) => breakpoint.minWidth === 0
- );
+ // Take the smallest breakpoint as default
+ const defaultBreakpoint = sort(breakpoints)[0];
if (defaultBreakpoint === undefined) {
throw new Error("A breakpoint with minWidth 0 is required");
}