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.

nits on some colors used, add todos, eslint

Sultan4f7b26f7b5e9
diff --git a/apps/designer/app/designer/designer.tsx b/apps/designer/app/designer/designer.tsx
index d41038b6c5..3bd4979f22 100644
--- a/apps/designer/app/designer/designer.tsx
+++ b/apps/designer/app/designer/designer.tsx
@@ -7,7 +7,12 @@ import type {
HoveredInstanceData,
SelectedInstanceData,
} from "~/shared/canvas-components";
-import { darkTheme, Box, Flex, Grid, type CSS } from "~/shared/design-system";
+import {
+ /* darkTheme, */ Box,
+ Flex,
+ Grid,
+ type CSS,
+} from "~/shared/design-system";
import interStyles from "~/shared/font-faces/inter.css";
import { SidebarLeft } from "./features/sidebar-left";
import { Inspector } from "./features/inspector";
@@ -154,22 +159,18 @@ const ChromeWrapper = ({ children, isPreviewMode }: ChromeWrapperProps) => {
overflow: "hidden",
display: "grid",
...gridLayout,
- "--outline": "$colors$slate6",
- "&.dark-theme": {
- "--outline": "rgba(255, 255, 255, 8%)",
- },
"&.dark-theme header": {
- boxShadow: "inset 0 -1px 0 0 var(--outline)",
+ boxShadow: "inset 0 -1px 0 0 $colors$gray7",
},
"&.dark-theme footer": {
- boxShadow: "inset 0 1px 0 0 var(--outline)",
+ boxShadow: "inset 0 1px 0 0 $colors$gray7",
},
"& aside": {
"&:first-of-type": {
- boxShadow: "inset -1px 0 0 0 var(--outline)",
+ boxShadow: "inset -1px 0 0 0 $colors$gray7",
},
"&:last-of-type": {
- boxShadow: "inset 1px 0 0 0 var(--outline)",
+ boxShadow: "inset 1px 0 0 0 $colors$gray7",
},
},
}}
diff --git a/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsx b/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsx
index f879b4d675..9928a12213 100644
--- a/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsx
+++ b/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsx
@@ -14,10 +14,12 @@ const Breadcrumb = ({ component, onClick }: BreadcrumbProps) => {
<Flex
align="center"
css={{
+ // @todo: this could be on the button itself, right?
"& button": {
color: "$hiContrast",
px: "0",
},
+ // @todo: and this on the svg, e.g. styled(Chevron...)(style)
"& path": {
fill: "$hiContrast",
},
diff --git a/apps/designer/app/designer/features/inspector/inspector.tsx b/apps/designer/app/designer/features/inspector/inspector.tsx
index 22cd7185b1..61c9287aee 100644
--- a/apps/designer/app/designer/features/inspector/inspector.tsx
+++ b/apps/designer/app/designer/features/inspector/inspector.tsx
@@ -11,7 +11,6 @@ import {
} from "~/shared/design-system";
import { StylePanel } from "~/designer/features/style-panel";
import { PropsPanel } from "~/designer/features/props-panel";
-import { BrushIcon, GearIcon } from "~/shared/icons";
import { useSelectedInstanceData } from "~/designer/shared/nano-states";
type InspectorProps = {
@@ -30,7 +29,7 @@ export const Inspector = ({ publish }: InspectorProps) => {
if (selectedInstanceData === undefined) {
return (
<Box css={{ p: "$2" }}>
- {/* @todo: use this space for something more usefull: a-la figma's no instance selected sate */}
+ {/* @todo: use this space for something more usefull: a-la figma's no instance selected sate, maybe create an issue with a more specific proposal? */}
<Card css={{ p: "$3", mt: "$3" }}>
<Paragraph>Select an instance on the canvas</Paragraph>
</Card>
@@ -39,6 +38,7 @@ export const Inspector = ({ publish }: InspectorProps) => {
}
return (
+ // @todo: Nit: I wonder if this width was supposed to be defined by the parent container layout
<Tabs defaultValue="style" css={{ width: "100%" }}>
<TabsList>
<TabsTrigger value="style">
diff --git a/apps/designer/app/designer/features/sidebar-left/sidebar-left.tsx b/apps/designer/app/designer/features/sidebar-left/sidebar-left.tsx
index c838d65590..dd17e0af18 100644
--- a/apps/designer/app/designer/features/sidebar-left/sidebar-left.tsx
+++ b/apps/designer/app/designer/features/sidebar-left/sidebar-left.tsx
@@ -17,7 +17,7 @@ const sidebarTabsContentStyle = {
width: 250,
height: "100%",
bc: "$loContrast",
- // @todo: focus state should be same as hover/active state
+ // @todo: focus state should be same as hover/active state: hover and focus yes, probably same, active? not so sure.
outline: "none",
};
diff --git a/apps/designer/app/designer/features/style-panel/search.tsx b/apps/designer/app/designer/features/style-panel/search.tsx
index 4853772cef..04d9898c38 100644
--- a/apps/designer/app/designer/features/style-panel/search.tsx
+++ b/apps/designer/app/designer/features/style-panel/search.tsx
@@ -45,7 +45,7 @@ export const Search = ({ onSearch }: SearchProps) => {
<TextField
value={search}
css={{
- padding: "$2 $2",
+ padding: "$2",
boxShadow: "0 0 0 1px $colors$slate7",
bc: "$colors$slate3",
"&:focus": {
@@ -65,6 +65,7 @@ export const Search = ({ onSearch }: SearchProps) => {
aria-label="Reset search"
className={resetStyle()}
css={{
+ // @todo: feels wrong to use transform for this, would setting width/height on the icon directly be a better approach?
transform: "scale(.75)",
"&:disabled path": { fill: "none" },
}}
diff --git a/apps/designer/app/designer/features/style-panel/settings.tsx b/apps/designer/app/designer/features/style-panel/settings.tsx
index b8e79436c3..5e6c920ed6 100644
--- a/apps/designer/app/designer/features/style-panel/settings.tsx
+++ b/apps/designer/app/designer/features/style-panel/settings.tsx
@@ -6,7 +6,7 @@ import {
type Category,
type Style,
} from "@webstudio-is/sdk";
-import { Box, Flex, Collapsible, Button } from "~/shared/design-system";
+import { Flex, Collapsible, Button } from "~/shared/design-system";
import { TriangleRightIcon, TriangleDownIcon } from "~/shared/icons";
import { styleConfigs, type StyleConfig } from "~/shared/style-panel-configs";
import { CollapsibleSection } from "~/designer/shared/inspector";
diff --git a/apps/designer/app/designer/features/style-panel/style-panel.tsx b/apps/designer/app/designer/features/style-panel/style-panel.tsx
index 6f2b97550a..9851fd96ac 100644
--- a/apps/designer/app/designer/features/style-panel/style-panel.tsx
+++ b/apps/designer/app/designer/features/style-panel/style-panel.tsx
@@ -3,7 +3,6 @@ import { willRender } from "~/designer/shared/breakpoints";
import { Box, Card, Paragraph } from "~/shared/design-system";
import type { SelectedInstanceData } from "~/shared/canvas-components";
import { useStyleData } from "./use-style-data";
-import { ComponentInfo } from "../../shared/inspector";
import { VisualSettings } from "./settings";
import { Search } from "./search";
import { useState } from "react";
@@ -59,7 +58,7 @@ export const StylePanel = ({
<ComponentInfo selectedInstanceData={selectedInstanceData} />
</Box> */}
<Box css={{ overflow: "auto" }}>
- <Box css={{ py: "$3", px: "$3" }}>
+ <Box css={{ py: "$3", px: "$3", paddingTop: "$4" }}>
<Search onSearch={setSearch} />
</Box>
<VisualSettings
diff --git a/apps/designer/app/designer/features/topbar/menu/menu.tsx b/apps/designer/app/designer/features/topbar/menu/menu.tsx
index 2211c40951..e60f294296 100644
--- a/apps/designer/app/designer/features/topbar/menu/menu.tsx
+++ b/apps/designer/app/designer/features/topbar/menu/menu.tsx
@@ -10,7 +10,6 @@ import {
IconButton,
Text,
Box,
- type CSS,
} from "~/shared/design-system";
import { HamburgerMenuIcon } from "~/shared/icons";
import type { Config } from "~/config";
@@ -36,10 +35,9 @@ const textCss = {
type MenuProps = {
config: Config;
publish: Publish;
- css?: CSS;
};
-export const Menu = ({ config, publish, css }: MenuProps) => {
+export const Menu = ({ config, publish }: MenuProps) => {
const navigate = useNavigate();
const [, setIsShareOpen] = useIsShareDialogOpen();
const [, setIsPublishOpen] = useIsPublishDialogOpen();
@@ -53,6 +51,7 @@ export const Menu = ({ config, publish, css }: MenuProps) => {
height: "100%",
borderRadius: "0",
outline: "none",
+ // @todo: would set directly on the element
"& > button": {
width: "inherit",
height: "inherit",
diff --git a/apps/designer/app/designer/features/topbar/topbar.tsx b/apps/designer/app/designer/features/topbar/topbar.tsx
index 4bddac48ad..17e10fc5f7 100644
--- a/apps/designer/app/designer/features/topbar/topbar.tsx
+++ b/apps/designer/app/designer/features/topbar/topbar.tsx
@@ -25,6 +25,7 @@ export const Topbar = ({ config, css, project, publish }: TopbarProps) => {
css={{
bc: "$loContrast",
height: "$sizes$7",
+ // @todo: uhh, setting this on any focused child element? lets see what's the use case and why its necessary to override vs. not having it in the first place
"& :focus": {
boxShadow: "none",
},
diff --git a/apps/designer/app/designer/shared/inspector/collapsible-section.tsx b/apps/designer/app/designer/shared/inspector/collapsible-section.tsx
index 6804de9bd7..beb9a2193b 100644
--- a/apps/designer/app/designer/shared/inspector/collapsible-section.tsx
+++ b/apps/designer/app/designer/shared/inspector/collapsible-section.tsx
@@ -1,11 +1,6 @@
import { createValueContainer, useValue } from "react-nano-state";
import { Box, Flex, Text, Collapsible } from "~/shared/design-system";
-import {
- TriangleRightIcon,
- TriangleDownIcon,
- PlusIcon,
- MinusIcon,
-} from "~/shared/icons";
+import { PlusIcon, MinusIcon } from "~/shared/icons";
type CollapsibleSectionProps = {
label: string;
@@ -43,7 +38,7 @@ export const CollapsibleSection = ({
<Collapsible.Root open={isOpenFinal} onOpenChange={setIsOpenByUser}>
<Box
css={{
- boxShadow: "0px 1px 0 $colors$slate6",
+ boxShadow: "0px 1px 0 $colors$gray6",
}}
>
<Collapsible.Trigger asChild>
diff --git a/apps/designer/app/shared/design-system/components/tabs.tsx b/apps/designer/app/shared/design-system/components/tabs.tsx
index 2dbb6d7b1a..6845bd1a56 100644
--- a/apps/designer/app/shared/design-system/components/tabs.tsx
+++ b/apps/designer/app/shared/design-system/components/tabs.tsx
@@ -29,8 +29,8 @@ export const TabsTrigger = styled(TabsPrimitive.Trigger, {
paddingLeft: "$3",
},
[`& > ${Text}`]: {
- color: "$slate9",
- fontSize: "$1",
+ color: "$gray9",
+ fontSize: "11px",
fontWeight: "600",
},
"@hover": {
@@ -53,14 +53,14 @@ export const TabsTrigger = styled(TabsPrimitive.Trigger, {
const StyledTabsList = styled(TabsPrimitive.List, {
flexShrink: 0,
display: "flex",
- borderBottom: "1px solid $colors$slate6",
+ borderBottom: "1px solid $colors$gray6",
"&:focus": {
outline: "none",
- boxShadow: "inset 0 0 0 1px $slate8, 0 0 0 1px $slate8",
+ boxShadow: "inset 0 0 0 1px $gray8, 0 0 0 1px $gray8",
},
'&[data-orientation="vertical"]': {
flexDirection: "column",
- boxShadow: "inset -1px 0 0 $slate6",
+ boxShadow: "inset -1px 0 0 $gray6",
},
});
@@ -82,7 +82,7 @@ export const TabsContent = styled(TabsPrimitive.Content, {
flexGrow: 1,
"&:focus": {
outline: "none",
- boxShadow: "inset 0 0 0 1px $slate8, 0 0 0 1px $slate8",
+ boxShadow: "inset 0 0 0 1px $gray8, 0 0 0 1px $gray8",
},
'&[data-state="inactive"]': {
display: "none",
diff --git a/apps/designer/app/shared/design-system/stitches.config.ts b/apps/designer/app/shared/design-system/stitches.config.ts
index c783e8f5a9..3d8a0e3dc0 100644
--- a/apps/designer/app/shared/design-system/stitches.config.ts
+++ b/apps/designer/app/shared/design-system/stitches.config.ts
@@ -497,6 +497,7 @@ export const darkTheme = createTheme("dark-theme", {
muted: "$slate8",
primary: "$blue9",
hiContrast: "$slate12",
+ // radix colors in this range are either too dark/too light, nothing gray/black in the 16-17% luminosity range
loContrast: "hsl(0 0% 17%)",
canvas: "hsl(0 0% 15%)",
panel: "$slate3",
diff --git a/apps/designer/app/shared/documents/designer.tsx b/apps/designer/app/shared/documents/designer.tsx
index 23dafb5f29..95605b1931 100644
--- a/apps/designer/app/shared/documents/designer.tsx
+++ b/apps/designer/app/shared/documents/designer.tsx
@@ -1,6 +1,5 @@
import { Links, LiveReload, Meta, Outlet, Scripts } from "@remix-run/react";
import { CriticalCss } from "@webstudio-is/sdk";
-import { darkTheme } from "~/shared/design-system";
import { Env } from "~/shared/env";
export const Designer = () => {