diff --git a/src/components/create-theme.tsx b/src/components/create-theme.tsx index 358b91a..b6f803a 100644 --- a/src/components/create-theme.tsx +++ b/src/components/create-theme.tsx @@ -6,6 +6,7 @@ import React from "react"; import styled from "styled-components"; import { Dialog, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "@radix-ui/react-dialog"; import { DialogFooter, DialogHeader } from "./ui/dialog"; +import { Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./ui/sheet"; const COLORS = [ "#ffaa40", @@ -81,12 +82,23 @@ export default function CreateThemePage() { }, [isDarkMode]); const generateThemeData = () => { - return JSON.stringify({ - primaryColor, - secondaryColor, - tertiaryColor, - colorsBorder, - }, null, 4); + let theme: any = { + isDarkMode, + }; + // Dont add the default values + if (primaryColor !== (isDarkMode ? defaultStyles.primaryColor.dark : defaultStyles.primaryColor.light)) { + theme["primaryColor"] = primaryColor; + } + if (secondaryColor !== (isDarkMode ? defaultStyles.secondaryColor.dark : defaultStyles.secondaryColor.light)) { + theme["secondaryColor"] = secondaryColor; + } + if (tertiaryColor !== (isDarkMode ? defaultStyles.tertiaryColor.dark : defaultStyles.tertiaryColor.light)) { + theme["tertiaryColor"] = tertiaryColor; + } + if (colorsBorder !== (isDarkMode ? defaultStyles.colorsBorder.dark : defaultStyles.colorsBorder.light)) { + theme["colorsBorder"] = colorsBorder + } + return JSON.stringify(theme, null, 4); } return ( @@ -96,7 +108,7 @@ export default function CreateThemePage() { secondaryColor={secondaryColor} tertiaryColor={tertiaryColor} colorsBorder={colorsBorder} - className="flex flex-col mt-52 items-center justify-center w-full min-h-screen"> + className="flex flex-col mt-32 items-center justify-center w-full min-h-screen">

Create your theme

Create your own theme for Zen Browser and share it with the community.

@@ -144,27 +156,32 @@ export default function CreateThemePage() { setColorsBorder(e.target.value)} />
- - + + - - - - Theme data - + + + + Theme data + Copy the following JSON object and paste it into your Zen Browser theme format. - - -
{generateThemeData()}
- + + +
{generateThemeData()}
+ -
-
-
+ + + + {/* Preview */}