Skip to content

Commit eaf39c5

Browse files
authored
feat: make loading screen background dark (#4449)
## Description A better looking loading screen ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent 7c3bf00 commit eaf39c5

File tree

6 files changed

+11
-13
lines changed

6 files changed

+11
-13
lines changed

apps/builder/app/builder/builder.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ body {
66
overflow: hidden;
77
overscroll-behavior: contain;
88
-webkit-font-smoothing: antialiased;
9+
/*
10+
This is the top bar and loading screen color (--colors-backgroundTopbar).
11+
We are setting it to avoid a white screen flash when opening project from the dashboard.
12+
*/
13+
background-color: #2d2d2d;
914
}
1015

1116
[data-radix-scroll-area-viewport] {

apps/builder/app/builder/builder.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const SidePanel = ({
104104
fg: 0,
105105
// Left sidebar tabs won't be able to pop out to the right if we set overflowX to auto.
106106
//overflowY: "auto",
107-
bc: theme.colors.backgroundPanel,
107+
backgroundColor: theme.colors.backgroundPanel,
108108
height: "100%",
109109
...css,
110110
}}
@@ -413,7 +413,6 @@ export const Builder = ({
413413
? false
414414
: true
415415
}
416-
backgroundColor={theme.colors.backgroundTopbar}
417416
/>
418417
}
419418
/>

apps/builder/app/builder/shared/loading.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ import { useInterval } from "~/shared/hook-utils/use-interval";
55

66
export const LoadingBackground = ({
77
show,
8-
backgroundColor,
98
onTransitionEnd,
109
}: {
1110
show: boolean;
12-
backgroundColor: string;
1311
onTransitionEnd?: () => void;
1412
}) => {
1513
const [transitionEnded, setTransitionEnded] = useState(false);
@@ -26,7 +24,7 @@ export const LoadingBackground = ({
2624
transitionDuration: "300ms",
2725
pointerEvents: "none",
2826
transitionProperty: "opacity",
29-
backgroundColor,
27+
backgroundColor: theme.colors.backgroundTopbar,
3028
opacity: show ? 1 : 0,
3129
isolation: "isolate",
3230
}}
@@ -83,7 +81,6 @@ export const Loading = ({ state }: { state: LoadingState }) => {
8381
>
8482
<LoadingBackground
8583
show={state.state !== "ready"}
86-
backgroundColor={theme.colors.backgroundCanvas}
8784
onTransitionEnd={() => {
8885
setTransitionEnded(true);
8986
}}
@@ -96,10 +93,7 @@ export const Loading = ({ state }: { state: LoadingState }) => {
9693
gap="3"
9794
css={{ isolation: "isolate" }}
9895
>
99-
<WebstudioIcon
100-
size={60}
101-
style={{ filter: "drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.7))" }}
102-
/>
96+
<WebstudioIcon size={60} />
10397
<Progress value={fakeProgress} />
10498
</Flex>
10599
)}

apps/builder/app/builder/sidebar-left/sidebar-tabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const SidebarTabsContent = styled(TabsContent, {
104104
top: 0,
105105
left: "100%",
106106
height: "100%",
107-
bc: theme.colors.backgroundPanel,
107+
backgroundColor: theme.colors.backgroundPanel,
108108
outline: "none",
109109
// Drawing border this way to ensure content still has full width, avoid subpixels and give layout round numbers
110110
"&::after": {

apps/builder/app/dashboard/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import type { UserPlanFeatures } from "~/shared/db/user-plan-features.server";
2727

2828
const containerStyle = css({
2929
px: theme.spacing[13],
30-
bc: theme.colors.backgroundPanel,
30+
backgroundColor: theme.colors.backgroundPanel,
3131
height: theme.spacing[15],
3232
boxShadow: theme.shadows.brandElevationBig,
3333
});

packages/design-system/src/components/list-position-indicator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const CircleOutline = styled(Box, {
2727
left: -CIRCLE_SIZE / 2 - OUTLINE_WIDTH,
2828
borderRadius: "50%",
2929
pointerEvents: "none",
30-
bc: theme.colors.borderContrast,
30+
backgroundColor: theme.colors.borderContrast,
3131
});
3232

3333
const Circle = styled(Box, {

0 commit comments

Comments
 (0)