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.

refactor: drop theme switcher (#3110)

Bogdan Chadkin13b6d79c3fda
diff --git a/apps/builder/app/builder/features/footer/breadcrumbs.tsx b/apps/builder/app/builder/features/footer/breadcrumbs.tsx
index f5624e6a61..9ae31dc17f 100644
--- a/apps/builder/app/builder/features/footer/breadcrumbs.tsx
+++ b/apps/builder/app/builder/features/footer/breadcrumbs.tsx
@@ -22,14 +22,7 @@ export const Breadcrumbs = () => {
const metas = useStore($registeredComponentMetas);
return (
- <Flex
- align="center"
- css={{
- height: "100%",
- color: theme.colors.hiContrast,
- px: theme.spacing[3],
- }}
- >
+ <Flex align="center" css={{ height: "100%", px: theme.spacing[3] }}>
{selectedInstanceSelector === undefined ? (
<Text>No instance selected</Text>
) : (
@@ -54,6 +47,7 @@ export const Breadcrumbs = () => {
px: theme.spacing[5],
borderRadius: "100vh",
height: "100%",
+ color: "inherit",
}}
key={instance.id}
onClick={() => {
diff --git a/apps/builder/app/builder/features/footer/footer.tsx b/apps/builder/app/builder/features/footer/footer.tsx
index 9ad6322362..a8c8996b18 100644
--- a/apps/builder/app/builder/features/footer/footer.tsx
+++ b/apps/builder/app/builder/features/footer/footer.tsx
@@ -1,17 +1,16 @@
-import { Flex, darkTheme } from "@webstudio-is/design-system";
+import { Flex, theme } from "@webstudio-is/design-system";
import { Breadcrumbs } from "./breadcrumbs";
-import { theme } from "@webstudio-is/design-system";
export const Footer = () => {
return (
<Flex
- className={darkTheme}
as="footer"
align="center"
css={{
gridArea: "footer",
height: theme.spacing[11],
- background: theme.colors.loContrast,
+ background: theme.colors.backgroundTopbar,
+ color: theme.colors.foregroundContrastMain,
boxShadow: `inset 0 1px 0 0 ${theme.colors.panelOutline}`,
}}
>
diff --git a/apps/builder/app/builder/features/topbar/menu/menu.tsx b/apps/builder/app/builder/features/topbar/menu/menu.tsx
index a6f8a7ae48..e906eeb554 100644
--- a/apps/builder/app/builder/features/topbar/menu/menu.tsx
+++ b/apps/builder/app/builder/features/topbar/menu/menu.tsx
@@ -1,6 +1,5 @@
import { useNavigate } from "@remix-run/react";
import { useStore } from "@nanostores/react";
-import { isFeatureEnabled } from "@webstudio-is/feature-flags";
import {
theme,
DropdownMenu,
@@ -22,11 +21,6 @@ import {
$userPlanFeatures,
$isCloneDialogOpen,
} from "~/builder/shared/nano-states";
-import {
- getThemeSetting,
- setThemeSetting,
- type ThemeSetting,
-} from "~/shared/theme";
import { useClientSettings } from "~/builder/shared/client-settings";
import { dashboardPath } from "~/shared/router-utils";
import { $authPermit, $authTokenPermissions } from "~/shared/nano-states";
@@ -35,39 +29,6 @@ import { MenuButton } from "./menu-button";
import { $isProjectSettingsOpen } from "~/shared/nano-states/seo";
import { UploadIcon } from "@webstudio-is/icons";
-const ThemeMenuItem = () => {
- if (isFeatureEnabled("dark") === false) {
- return null;
- }
- const currentSetting = getThemeSetting();
- const labels: Record<ThemeSetting, string> = {
- light: "Light",
- dark: "Dark",
- system: "System theme",
- };
-
- const settings = Object.keys(labels) as Array<ThemeSetting>;
-
- return (
- <DropdownMenuSub>
- <DropdownMenuSubTrigger>Theme</DropdownMenuSubTrigger>
- <DropdownMenuSubContent width="regular">
- {settings.map((setting) => (
- <DropdownMenuCheckboxItem
- key={setting}
- checked={currentSetting === setting}
- onSelect={() => {
- setThemeSetting(setting);
- }}
- >
- {labels[setting]}
- </DropdownMenuCheckboxItem>
- ))}
- </DropdownMenuSubContent>
- </DropdownMenuSub>
- );
-};
-
const ViewMenuItem = () => {
const [clientSettings, setClientSetting] = useClientSettings();
@@ -182,7 +143,6 @@ export const Menu = () => {
</DropdownMenuItemRightSlot>
</DropdownMenuItem>
<DropdownMenuSeparator />
- <ThemeMenuItem />
<DropdownMenuItem onSelect={() => emitCommand("togglePreview")}>
Preview
<DropdownMenuItemRightSlot>
diff --git a/apps/builder/app/routes/builder.tsx b/apps/builder/app/routes/builder.tsx
index ecf987f8f2..83dcdbe0df 100644
--- a/apps/builder/app/routes/builder.tsx
+++ b/apps/builder/app/routes/builder.tsx
@@ -1,17 +1,7 @@
-import type {
- LoaderFunctionArgs,
- ServerRuntimeMetaFunction as MetaFunction,
-} from "@remix-run/server-runtime";
+import type { ServerRuntimeMetaFunction as MetaFunction } from "@remix-run/server-runtime";
import { Root } from "~/shared/remix";
-import { getThemeData } from "~/shared/theme";
import type { ShouldRevalidateFunction } from "@remix-run/react";
-export const loader = async ({ request }: LoaderFunctionArgs) => {
- return {
- theme: await getThemeData(request),
- };
-};
-
export const meta: MetaFunction = () => {
return [{ title: "Webstudio" }];
};
diff --git a/apps/builder/app/routes/dashboard.tsx b/apps/builder/app/routes/dashboard.tsx
index 9d3f9f4a36..67b4800b4c 100644
--- a/apps/builder/app/routes/dashboard.tsx
+++ b/apps/builder/app/routes/dashboard.tsx
@@ -1,15 +1,5 @@
-import type {
- LoaderFunctionArgs,
- ServerRuntimeMetaFunction as MetaFunction,
-} from "@remix-run/server-runtime";
+import type { ServerRuntimeMetaFunction as MetaFunction } from "@remix-run/server-runtime";
import { Root } from "~/shared/remix";
-import { getThemeData } from "~/shared/theme";
-
-export const loader = async ({ request }: LoaderFunctionArgs) => {
- return {
- theme: await getThemeData(request),
- };
-};
export const meta: MetaFunction = () => {
return [{ title: "Webstudio Dashboard" }];
diff --git a/apps/builder/app/routes/login.tsx b/apps/builder/app/routes/login.tsx
index 06eebc5610..a010e0e7ca 100644
--- a/apps/builder/app/routes/login.tsx
+++ b/apps/builder/app/routes/login.tsx
@@ -1,15 +1,5 @@
-import type {
- LoaderFunctionArgs,
- ServerRuntimeMetaFunction as MetaFunction,
-} from "@remix-run/server-runtime";
+import type { ServerRuntimeMetaFunction as MetaFunction } from "@remix-run/server-runtime";
import { Root } from "~/shared/remix";
-import { getThemeData } from "~/shared/theme";
-
-export const loader = async ({ request }: LoaderFunctionArgs) => {
- return {
- theme: await getThemeData(request),
- };
-};
export const meta: MetaFunction = () => {
return [{ title: "Webstudio Login" }];
diff --git a/apps/builder/app/routes/n8n.tsx b/apps/builder/app/routes/n8n.tsx
index b503b58a67..d95f07ce0d 100644
--- a/apps/builder/app/routes/n8n.tsx
+++ b/apps/builder/app/routes/n8n.tsx
@@ -1,15 +1,5 @@
-import type {
- LoaderFunctionArgs,
- ServerRuntimeMetaFunction as MetaFunction,
-} from "@remix-run/server-runtime";
+import type { ServerRuntimeMetaFunction as MetaFunction } from "@remix-run/server-runtime";
import { Root } from "~/shared/remix";
-import { getThemeData } from "~/shared/theme";
-
-export const loader = async ({ request }: LoaderFunctionArgs) => {
- return {
- theme: await getThemeData(request),
- };
-};
export const meta: MetaFunction = () => {
return [{ title: "Webstudio" }];
diff --git a/apps/builder/app/routes/rest.theme.$setting.ts b/apps/builder/app/routes/rest.theme.$setting.ts
deleted file mode 100644
index 4fb1ec639c..0000000000
--- a/apps/builder/app/routes/rest.theme.$setting.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { json, type LoaderFunctionArgs } from "@remix-run/server-runtime";
-import { themeCookieParser } from "~/shared/theme";
-
-export const loader = async ({ params }: LoaderFunctionArgs) => {
- const { setting } = params;
- const headers = {
- "Set-Cookie": await themeCookieParser.serialize(setting),
- };
- return json({ setting }, { headers });
-};
diff --git a/apps/builder/app/shared/router-utils/path-utils.ts b/apps/builder/app/shared/router-utils/path-utils.ts
index 6bcead72a3..6bffa420c8 100644
--- a/apps/builder/app/shared/router-utils/path-utils.ts
+++ b/apps/builder/app/shared/router-utils/path-utils.ts
@@ -1,6 +1,5 @@
import type { AUTH_PROVIDERS } from "~/shared/session";
import type { Project } from "@webstudio-is/project";
-import type { ThemeSetting } from "~/shared/theme";
import { $authToken } from "../nano-states";
const searchParams = (params: Record<string, string | undefined | null>) => {
@@ -134,9 +133,6 @@ export const restAssetsUploadPath = ({ name }: { name: string }) => {
return `/rest/assets/${name}`;
};
-export const restThemePath = ({ setting }: { setting: ThemeSetting }) =>
- `/rest/theme/${setting}`;
-
export const restPatchPath = (props: { authToken?: string }) => {
const urlSearchParams = new URLSearchParams();
if (props.authToken !== undefined) {
diff --git a/apps/builder/app/shared/theme/index.ts b/apps/builder/app/shared/theme/index.ts
deleted file mode 100644
index b47713ebdd..0000000000
--- a/apps/builder/app/shared/theme/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-// This article explains the foundation of the technique we are using
-// https://rossmoody.com/writing/remix-stitches
-
-export * from "./theme";
-export * from "./theme.server";
-export type { ThemeSetting } from "./types";
diff --git a/apps/builder/app/shared/theme/theme.server.ts b/apps/builder/app/shared/theme/theme.server.ts
deleted file mode 100644
index 8252b8b984..0000000000
--- a/apps/builder/app/shared/theme/theme.server.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { createCookie } from "@remix-run/node";
-import type { ColorScheme, ThemeSetting } from "./types";
-
-const cookieNamespace = "theme";
-
-export const themeCookieParser = createCookie(cookieNamespace);
-
-export const getThemeData = async (
- request: Request
-): Promise<{ system?: ColorScheme; setting?: ThemeSetting }> => {
- const system = (request.headers.get("Sec-CH-Prefers-Color-Scheme") ??
- undefined) as ColorScheme | undefined;
- const setting: ThemeSetting =
- (await themeCookieParser.parse(request.headers.get("Cookie"))) ?? undefined;
- return { system, setting };
-};
diff --git a/apps/builder/app/shared/theme/theme.ts b/apps/builder/app/shared/theme/theme.ts
deleted file mode 100644
index f17a2fd0f6..0000000000
--- a/apps/builder/app/shared/theme/theme.ts
+++ /dev/null
@@ -1,112 +0,0 @@
-import { useLoaderData } from "@remix-run/react";
-import { isFeatureEnabled } from "@webstudio-is/feature-flags";
-import { darkTheme } from "@webstudio-is/design-system";
-import { restThemePath } from "~/shared/router-utils";
-import type { ColorScheme, ThemeSetting } from "./types";
-import { useState } from "react";
-
-// User selected theme setting.
-let setting: ThemeSetting = isFeatureEnabled("dark") ? "system" : "light";
-// Current systeme theme.
-let system: ColorScheme;
-
-/**
- * Subscribes color scheme change event and rerenders
- */
-const subscribeSystemTheme = () => {
- if (typeof matchMedia === "undefined") {
- return;
- }
- const query = matchMedia("(prefers-color-scheme: light)");
- const queryColorScheme = (query: MediaQueryList | MediaQueryListEvent) =>
- query.matches ? "light" : "dark";
-
- system = queryColorScheme(query);
-
- query.addEventListener("change", (queryEvent) => {
- system = queryColorScheme(queryEvent);
- renderThemeProps();
- });
-};
-
-subscribeSystemTheme();
-
-const fallbackTheme = "light";
-
-/**
- * Logic we use to decide depending on user setting which color scheme to use.
- */
-const getColorScheme = (): ColorScheme => {
- if (setting === "system") {
- return system || fallbackTheme;
- }
- return setting || fallbackTheme;
-};
-
-/**
- * When switching theme we need to apply the class/style manually.
- */
-const renderThemeProps = () => {
- const theme = getColorScheme();
- const root = document.documentElement;
- theme === "dark"
- ? root.classList.add(darkTheme.className)
- : root.classList.remove(darkTheme.className);
- root.style.colorScheme = theme;
- root.dataset.theme = theme;
-};
-
-/**
- * Apply immediately and set the cookie on the server.
- */
-export const setThemeSetting = (nextSetting: ThemeSetting) => {
- setting = nextSetting;
- renderThemeProps();
- fetch(restThemePath({ setting }));
-};
-
-/**
- * Returns the class and style to applied to some root node serverside and during hydration.
- */
-export const useThemeProps = () => {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const data = useLoaderData<{ theme: any }>();
- if (data.theme.setting) {
- setting = data.theme.setting;
- }
- if (data.theme.system) {
- system = data.theme.system;
- }
-
- const [themeProps] = useState<{
- className: string | undefined;
- style: { colorScheme: ColorScheme };
- "data-theme": ColorScheme;
- }>({
- className: undefined,
- style: { colorScheme: "light" },
- "data-theme": "light",
- });
-
- /*
- // @todo uncomment when we will decide to use theme
- useEffect(() => {
- const theme = getColorScheme();
-
- setThemeProps(() => ({
- className: theme === "dark" ? darkTheme.className : undefined,
- style: { colorScheme: theme },
- "data-theme": theme,
- }));
- }, []);
- */
-
- return themeProps;
-};
-
-/**
- * Currently selected by user theme setting.
- */
-export const getThemeSetting = (): ThemeSetting => {
- return setting;
-};
diff --git a/apps/builder/app/shared/theme/types.ts b/apps/builder/app/shared/theme/types.ts
deleted file mode 100644
index 30553c6b07..0000000000
--- a/apps/builder/app/shared/theme/types.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export type ColorScheme = "dark" | "light";
-export type ThemeSetting = ColorScheme | "system";
diff --git a/packages/design-system/src/stitches.config.ts b/packages/design-system/src/stitches.config.ts
index 819ed95eb7..b84e7555b1 100644
--- a/packages/design-system/src/stitches.config.ts
+++ b/packages/design-system/src/stitches.config.ts
@@ -2,118 +2,62 @@ import { createStitches } from "@stitches/react";
import {
amber,
amberA,
- amberDark,
- amberDarkA,
blackA,
blue,
blueA,
- blueDark,
- blueDarkA,
bronze,
bronzeA,
- bronzeDark,
- bronzeDarkA,
brown,
brownA,
- brownDark,
- brownDarkA,
crimson,
crimsonA,
- crimsonDark,
- crimsonDarkA,
cyan,
cyanA,
- cyanDark,
- cyanDarkA,
gold,
goldA,
- goldDark,
- goldDarkA,
grass,
grassA,
- grassDark,
- grassDarkA,
gray,
grayA,
- grayDark,
- grayDarkA,
green,
greenA,
- greenDark,
- greenDarkA,
indigo,
indigoA,
- indigoDark,
- indigoDarkA,
lime,
limeA,
- limeDark,
- limeDarkA,
mauve,
mauveA,
- mauveDark,
- mauveDarkA,
mint,
mintA,
- mintDark,
- mintDarkA,
olive,
oliveA,
- oliveDark,
- oliveDarkA,
orange,
orangeA,
- orangeDark,
- orangeDarkA,
pink,
pinkA,
- pinkDark,
- pinkDarkA,
plum,
plumA,
- plumDark,
- plumDarkA,
purple,
purpleA,
- purpleDark,
- purpleDarkA,
red,
redA,
- redDark,
- redDarkA,
sage,
sageA,
- sageDark,
- sageDarkA,
sand,
sandA,
- sandDark,
- sandDarkA,
sky,
skyA,
- skyDark,
- skyDarkA,
slate,
slateA,
- slateDark,
- slateDarkA,
teal,
tealA,
- tealDark,
- tealDarkA,
tomato,
tomatoA,
- tomatoDark,
- tomatoDarkA,
violet,
violetA,
- violetDark,
- violetDarkA,
whiteA,
yellow,
yellowA,
- yellowDark,
- yellowDarkA,
} from "@radix-ui/colors";
import type * as Stitches from "@stitches/react";
export type { VariantProps } from "@stitches/react";
@@ -158,233 +102,227 @@ const spacing = {
35: "448px",
} as const;
-const {
- styled,
- css,
- createTheme,
- getCssText,
- globalCss,
- keyframes,
- config,
- reset,
-} = createStitches({
- theme: {
- colors: {
- ...gray,
- ...mauve,
- ...slate,
- ...sage,
- ...olive,
- ...sand,
- ...tomato,
- ...red,
- ...crimson,
- ...pink,
- ...plum,
- ...purple,
- ...violet,
- ...indigo,
- ...blue,
- ...sky,
- ...mint,
- ...cyan,
- ...teal,
- ...green,
- ...grass,
- ...lime,
- ...yellow,
- ...amber,
- ...orange,
- ...brown,
- ...bronze,
- ...gold,
+const { styled, css, getCssText, globalCss, keyframes, config, reset } =
+ createStitches({
+ theme: {
+ colors: {
+ ...gray,
+ ...mauve,
+ ...slate,
+ ...sage,
+ ...olive,
+ ...sand,
+ ...tomato,
+ ...red,
+ ...crimson,
+ ...pink,
+ ...plum,
+ ...purple,
+ ...violet,
+ ...indigo,
+ ...blue,
+ ...sky,
+ ...mint,
+ ...cyan,
+ ...teal,
+ ...green,
+ ...grass,
+ ...lime,
+ ...yellow,
+ ...amber,
+ ...orange,
+ ...brown,
+ ...bronze,
+ ...gold,
- ...grayA,
- ...mauveA,
- ...slateA,
- ...sageA,
- ...oliveA,
- ...sandA,
- ...tomatoA,
- ...redA,
- ...crimsonA,
- ...pinkA,
- ...plumA,
- ...purpleA,
- ...violetA,
- ...indigoA,
- ...blueA,
- ...skyA,
- ...mintA,
- ...cyanA,
- ...tealA,
- ...greenA,
- ...grassA,
- ...limeA,
- ...yellowA,
- ...amberA,
- ...orangeA,
- ...brownA,
- ...bronzeA,
- ...goldA,
+ ...grayA,
+ ...mauveA,
+ ...slateA,
+ ...sageA,
+ ...oliveA,
+ ...sandA,
+ ...tomatoA,
+ ...redA,
+ ...crimsonA,
+ ...pinkA,
+ ...plumA,
+ ...purpleA,
+ ...violetA,
+ ...indigoA,
+ ...blueA,
+ ...skyA,
+ ...mintA,
+ ...cyanA,
+ ...tealA,
+ ...greenA,
+ ...grassA,
+ ...limeA,
+ ...yellowA,
+ ...amberA,
+ ...orangeA,
+ ...brownA,
+ ...bronzeA,
+ ...goldA,
- ...whiteA,
- ...blackA,
+ ...whiteA,
+ ...blackA,
- // Semantic colors
- hiContrast: "$slate12",
- loContrast: "$slate1",
- hint: "$slate9",
- muted: "$slate6",
- primary: "$blue10",
- canvas: "hsl(0 0% 93%)",
- panel: "white",
- panelOutline: "hsl(0deg 0% 0% / 10%)",
- transparentPanel: "hsl(0 0% 0% / 97%)",
- shadowLight: "hsl(206 22% 7% / 35%)",
- shadowDark: "hsl(206 22% 7% / 20%)",
- background: "$slate1",
- text: "$slate12",
- transparentExtreme: "transparent",
+ // Semantic colors
+ hiContrast: "$slate12",
+ loContrast: "$slate1",
+ hint: "$slate9",
+ muted: "$slate6",
+ primary: "$blue10",
+ canvas: "hsl(0 0% 93%)",
+ panel: "white",
+ panelOutline: "hsl(0deg 0% 0% / 10%)",
+ transparentPanel: "hsl(0 0% 0% / 97%)",
+ shadowLight: "hsl(206 22% 7% / 35%)",
+ shadowDark: "hsl(206 22% 7% / 20%)",
+ background: "$slate1",
+ text: "$slate12",
+ transparentExtreme: "transparent",
- ...figma.color,
- },
- fonts: {
- ...figma.fontFamilies,
- sans: figma.fontFamilies.inter,
- mono: figma.fontFamilies.robotoMono,
- },
+ ...figma.color,
+ },
+ fonts: {
+ ...figma.fontFamilies,
+ sans: figma.fontFamilies.inter,
+ mono: figma.fontFamilies.robotoMono,
+ },
- opacity: {
- 1: "0.4",
- },
- spacing,
+ opacity: {
+ 1: "0.4",
+ },
+ spacing,
- /**
- * Use instead: textVariants / textStyles / <Text />
- */
- deprecatedFontSize: {
- 1: "8px",
- 2: "10px",
- 3: "12px",
- // Legacy - don't use unless specified in Figma
- 4: "14px",
- 5: "19px",
- 6: "21px",
- 7: "27px",
- 8: "35px",
- 9: "59px",
- },
+ /**
+ * Use instead: textVariants / textStyles / <Text />
+ */
+ deprecatedFontSize: {
+ 1: "8px",
+ 2: "10px",
+ 3: "12px",
+ // Legacy - don't use unless specified in Figma
+ 4: "14px",
+ 5: "19px",
+ 6: "21px",
+ 7: "27px",
+ 8: "35px",
+ 9: "59px",
+ },
- borderRadius: {
- 1: "1px",
- 2: "2px",
- 3: "3px",
- 4: "4px",
- 5: "5px",
- 6: "6px",
- 7: "8px",
- round: "50%",
- pill: "9999px",
- },
- zIndices: {
- 1: "100",
- 2: "200",
- 3: "300",
- 4: "400",
- max: "999",
+ borderRadius: {
+ 1: "1px",
+ 2: "2px",
+ 3: "3px",
+ 4: "4px",
+ 5: "5px",
+ 6: "6px",
+ 7: "8px",
+ round: "50%",
+ pill: "9999px",
+ },
+ zIndices: {
+ 1: "100",
+ 2: "200",
+ 3: "300",
+ 4: "400",
+ max: "999",
+ },
+ easing: {
+ easeOutQuart: "cubic-bezier(0.25, 1, 0.5, 1)",
+ easeOut: "cubic-bezier(0.16, 1, 0.3, 1)",
+ },
+ shadows: figma.boxShadow,
},
- easing: {
- easeOutQuart: "cubic-bezier(0.25, 1, 0.5, 1)",
- easeOut: "cubic-bezier(0.16, 1, 0.3, 1)",
+ media: {
+ tablet: "(min-width: 768px)",
+ laptop: "(min-width: 1024px)",
+ desktop: "(min-width: 1280px)",
+ motion: "(prefers-reduced-motion)",
+ hover: "(any-hover: hover)",
+ dark: "(prefers-color-scheme: dark)",
+ light: "(prefers-color-scheme: light)",
},
- shadows: figma.boxShadow,
- },
- media: {
- tablet: "(min-width: 768px)",
- laptop: "(min-width: 1024px)",
- desktop: "(min-width: 1280px)",
- motion: "(prefers-reduced-motion)",
- hover: "(any-hover: hover)",
- dark: "(prefers-color-scheme: dark)",
- light: "(prefers-color-scheme: light)",
- },
- utils: {
- p: (value: Stitches.PropertyValue<"padding">) => ({
- padding: value,
- }),
- pt: (value: Stitches.PropertyValue<"paddingTop">) => ({
- paddingTop: value,
- }),
- pr: (value: Stitches.PropertyValue<"paddingRight">) => ({
- paddingRight: value,
- }),
- pb: (value: Stitches.PropertyValue<"paddingBottom">) => ({
- paddingBottom: value,
- }),
- pl: (value: Stitches.PropertyValue<"paddingLeft">) => ({
- paddingLeft: value,
- }),
- px: (value: Stitches.PropertyValue<"paddingLeft">) => ({
- paddingLeft: value,
- paddingRight: value,
- }),
- py: (value: Stitches.PropertyValue<"paddingTop">) => ({
- paddingTop: value,
- paddingBottom: value,
- }),
+ utils: {
+ p: (value: Stitches.PropertyValue<"padding">) => ({
+ padding: value,
+ }),
+ pt: (value: Stitches.PropertyValue<"paddingTop">) => ({
+ paddingTop: value,
+ }),
+ pr: (value: Stitches.PropertyValue<"paddingRight">) => ({
+ paddingRight: value,
+ }),
+ pb: (value: Stitches.PropertyValue<"paddingBottom">) => ({
+ paddingBottom: value,
+ }),
+ pl: (value: Stitches.PropertyValue<"paddingLeft">) => ({
+ paddingLeft: value,
+ }),
+ px: (value: Stitches.PropertyValue<"paddingLeft">) => ({
+ paddingLeft: value,
+ paddingRight: value,
+ }),
+ py: (value: Stitches.PropertyValue<"paddingTop">) => ({
+ paddingTop: value,
+ paddingBottom: value,
+ }),
- m: (value: Stitches.PropertyValue<"margin">) => ({
- margin: value,
- }),
- mt: (value: Stitches.PropertyValue<"marginTop">) => ({
- marginTop: value,
- }),
- mr: (value: Stitches.PropertyValue<"marginRight">) => ({
- marginRight: value,
- }),
- mb: (value: Stitches.PropertyValue<"marginBottom">) => ({
- marginBottom: value,
- }),
- ml: (value: Stitches.PropertyValue<"marginLeft">) => ({
- marginLeft: value,
- }),
- mx: (value: Stitches.PropertyValue<"marginLeft">) => ({
- marginLeft: value,
- marginRight: value,
- }),
- my: (value: Stitches.PropertyValue<"marginTop">) => ({
- marginTop: value,
- marginBottom: value,
- }),
+ m: (value: Stitches.PropertyValue<"margin">) => ({
+ margin: value,
+ }),
+ mt: (value: Stitches.PropertyValue<"marginTop">) => ({
+ marginTop: value,
+ }),
+ mr: (value: Stitches.PropertyValue<"marginRight">) => ({
+ marginRight: value,
+ }),
+ mb: (value: Stitches.PropertyValue<"marginBottom">) => ({
+ marginBottom: value,
+ }),
+ ml: (value: Stitches.PropertyValue<"marginLeft">) => ({
+ marginLeft: value,
+ }),
+ mx: (value: Stitches.PropertyValue<"marginLeft">) => ({
+ marginLeft: value,
+ marginRight: value,
+ }),
+ my: (value: Stitches.PropertyValue<"marginTop">) => ({
+ marginTop: value,
+ marginBottom: value,
+ }),
- userSelect: (value: Stitches.PropertyValue<"userSelect">) => ({
- WebkitUserSelect: value,
- userSelect: value,
- }),
+ userSelect: (value: Stitches.PropertyValue<"userSelect">) => ({
+ WebkitUserSelect: value,
+ userSelect: value,
+ }),
- size: (value: Stitches.PropertyValue<"width">) => ({
- width: value,
- height: value,
- }),
+ size: (value: Stitches.PropertyValue<"width">) => ({
+ width: value,
+ height: value,
+ }),
- appearance: (value: Stitches.PropertyValue<"appearance">) => ({
- WebkitAppearance: value,
- appearance: value,
- }),
- backgroundClip: (value: Stitches.PropertyValue<"backgroundClip">) => ({
- WebkitBackgroundClip: value,
- backgroundClip: value,
- }),
+ appearance: (value: Stitches.PropertyValue<"appearance">) => ({
+ WebkitAppearance: value,
+ appearance: value,
+ }),
+ backgroundClip: (value: Stitches.PropertyValue<"backgroundClip">) => ({
+ WebkitBackgroundClip: value,
+ backgroundClip: value,
+ }),
- // LEGACY, please don't use them
- as: (value: Stitches.PropertyValue<"alignSelf">) => ({ alignSelf: value }),
- fg: (value: Stitches.PropertyValue<"flexGrow">) => ({ flexGrow: value }),
- bc: (value: Stitches.PropertyValue<"backgroundColor">) => ({
- backgroundColor: value,
- }),
- },
-});
+ // LEGACY, please don't use them
+ as: (value: Stitches.PropertyValue<"alignSelf">) => ({
+ alignSelf: value,
+ }),
+ fg: (value: Stitches.PropertyValue<"flexGrow">) => ({ flexGrow: value }),
+ bc: (value: Stitches.PropertyValue<"backgroundColor">) => ({
+ backgroundColor: value,
+ }),
+ },
+ });
type VariblesValues = typeof config.theme;
@@ -420,80 +358,3 @@ export const flushCss = () => {
reset();
return css;
};
-
-export const darkTheme = createTheme({
- colors: {
- ...grayDark,
- ...mauveDark,
- ...slateDark,
- ...sageDark,
- ...oliveDark,
- ...sandDark,
- ...tomatoDark,
- ...redDark,
- ...crimsonDark,
- ...pinkDark,
- ...plumDark,
- ...purpleDark,
- ...violetDark,
- ...indigoDark,
- ...blueDark,
- ...skyDark,
- ...mintDark,
- ...cyanDark,
- ...tealDark,
- ...greenDark,
- ...grassDark,
- ...limeDark,
- ...yellowDark,
- ...amberDark,
- ...orangeDark,
- ...brownDark,
- ...bronzeDark,
- ...goldDark,
-
- ...grayDarkA,
- ...mauveDarkA,
- ...slateDarkA,
- ...sageDarkA,
- ...oliveDarkA,
- ...sandDarkA,
- ...tomatoDarkA,
- ...redDarkA,
- ...crimsonDarkA,
- ...pinkDarkA,
- ...plumDarkA,
- ...purpleDarkA,
- ...violetDarkA,
- ...indigoDarkA,
- ...blueDarkA,
- ...skyDarkA,
- ...mintDarkA,
- ...cyanDarkA,
- ...tealDarkA,
- ...greenDarkA,
- ...grassDarkA,
- ...limeDarkA,
- ...yellowDarkA,
- ...amberDarkA,
- ...orangeDarkA,
- ...brownDarkA,
- ...bronzeDarkA,
- ...goldDarkA,
-
- // Semantic colors
- hiContrast: "$slate12",
- loContrast: "hsl(0 0% 17%)",
- hint: "$slate9",
- muted: "$slate8",
- primary: "$blue10",
- canvas: "hsl(0 0% 15%)",
- panel: "$slate3",
- panelOutline: "hsl(0deg 0% 100% / 10%)",
- transparentPanel: "hsl(0 100% 100% / 97%)",
- shadowLight: "hsl(206 22% 7% / 35%)",
- shadowDark: "hsl(206 22% 7% / 20%)",
- background: "$slate12",
- text: "$slate1",
- },
-});
diff --git a/packages/feature-flags/src/flags.ts b/packages/feature-flags/src/flags.ts
index cfb15201d0..d6ff41f9b2 100644
--- a/packages/feature-flags/src/flags.ts
+++ b/packages/feature-flags/src/flags.ts
@@ -1,6 +1,5 @@
// Only for development, is not supposed to be enabled at all.
export const displayContents = false;
-export const dark = false;
export const unsupportedBrowsers = false;
export const aiRadixComponents = false;
export const cms = false;