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.

better handle dark mode selector

Sultanaf0272e5d4df
diff --git a/apps/designer/app/designer/designer.tsx b/apps/designer/app/designer/designer.tsx
index d44c658b43..9405d0bf0d 100644
--- a/apps/designer/app/designer/designer.tsx
+++ b/apps/designer/app/designer/designer.tsx
@@ -7,12 +7,7 @@ import type {
HoveredInstanceData,
SelectedInstanceData,
} from "~/shared/canvas-components";
-import {
- /* darkTheme, */ Box,
- Flex,
- Grid,
- type CSS,
-} from "~/shared/design-system";
+import { 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";
@@ -106,6 +101,12 @@ const SidePanel = ({
bc: "$loContrast",
height: "100%",
...css,
+ "&:first-of-type": {
+ boxShadow: "inset -1px 0 0 0 $colors$gray7",
+ },
+ "&:last-of-type": {
+ boxShadow: "inset 1px 0 0 0 $colors$gray7",
+ },
}}
>
{children}
@@ -153,27 +154,11 @@ const ChromeWrapper = ({ children, isPreviewMode }: ChromeWrapperProps) => {
};
return (
<Grid
- // className={darkTheme}
css={{
height: "100vh",
overflow: "hidden",
display: "grid",
...gridLayout,
- // @todo refactor: works for now since i'm manually setting it above on grid container
- "&.dark-theme header": {
- boxShadow: "inset 0 -1px 0 0 $colors$gray7",
- },
- "&.dark-theme footer": {
- boxShadow: "inset 0 1px 0 0 $colors$gray7",
- },
- "& aside": {
- "&:first-of-type": {
- boxShadow: "inset -1px 0 0 0 $colors$gray7",
- },
- "&:last-of-type": {
- boxShadow: "inset 1px 0 0 0 $colors$gray7",
- },
- },
}}
>
{children}
@@ -241,9 +226,7 @@ export const Designer = ({ config, project }: DesignerProps) => {
>
{isDragging ? <TreePrevew /> : <Inspector publish={publish} />}
</SidePanel>
- <Box css={{ gridArea: "footer" }}>
- <Breadcrumbs publish={publish} />
- </Box>
+ <Breadcrumbs publish={publish} />
</ChromeWrapper>
</DndProvider>
);
diff --git a/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsx b/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsx
index 9928a12213..d8ce35c7fb 100644
--- a/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsx
+++ b/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsx
@@ -49,9 +49,13 @@ export const Breadcrumbs = ({ publish }: BreadcrumbsProps) => {
as="footer"
align="center"
css={{
+ gridArea: "footer",
height: "$5",
background: "$loContrast",
padding: "$2",
+ [`${darkTheme.selector}:root &`]: {
+ boxShadow: "inset 0 1px 0 0 $colors$gray7",
+ },
}}
>
{selectedInstancePath.length === 0 ? (
diff --git a/apps/designer/app/designer/features/topbar/topbar.tsx b/apps/designer/app/designer/features/topbar/topbar.tsx
index 17e10fc5f7..3be0785981 100644
--- a/apps/designer/app/designer/features/topbar/topbar.tsx
+++ b/apps/designer/app/designer/features/topbar/topbar.tsx
@@ -14,7 +14,6 @@ type TopbarProps = {
project: Project;
publish: Publish;
};
-
export const Topbar = ({ config, css, project, publish }: TopbarProps) => {
return (
<Flex
@@ -25,6 +24,9 @@ export const Topbar = ({ config, css, project, publish }: TopbarProps) => {
css={{
bc: "$loContrast",
height: "$sizes$7",
+ [`${darkTheme.selector}:root &`]: {
+ boxShadow: "inset 0 -1px 0 0 $colors$gray7",
+ },
// @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",