Skip to content

Commit 1cae8d1

Browse files
committed
style(app): improve layout and styling for responsiveness
- Add flex: 1 style to LazyFlex container in App component for better flex layout - Update inner LazyFlex in App with flex: 1 and height 100% for full height alignment - Remove fixed width and box-sizing from Settings component container and add flex: 1 - Change Sidebar height from fixed 560px to 100vh for full viewport height - Adjust SidebarButtons padding for better spacing and layout - Modify ThemeMenu thumbnails container flex from 7 to 1 and increase thumbnail size to 72px - Update ThemeMenu padding for uniform spacing - Add global CSS resets: margin 0, padding 0 and box-sizing border-box to all elements - Set root container to display flex and add padding to improve overall layout - Remove obsolete appVars global theme and update styles to avoid fixed widths
1 parent b98a33a commit 1cae8d1

File tree

9 files changed

+36
-21
lines changed

9 files changed

+36
-21
lines changed

src/App.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,23 @@ const App = () => {
4444

4545
return (
4646
<>
47-
<LazyFlex class={styles.app} align="center" gap="l" justify="stretch">
47+
<LazyFlex
48+
class={styles.app}
49+
align="center"
50+
gap="l"
51+
justify="stretch"
52+
style={{ flex: 1 }}
53+
>
4854
<Sidebar />
4955

5056
<Show when={!showSettings() && currentTheme()} fallback={<Settings />}>
51-
<LazyFlex direction="column" gap="l" align="center">
57+
<LazyFlex
58+
direction="column"
59+
gap="l"
60+
align="center"
61+
justify="center"
62+
style={{ flex: 1, height: "100%" }}
63+
>
5264
<Select
5365
options={monitors()}
5466
placeholder={translate("label-select-monitor")}

src/components/ImageCarousel/ImageCarousel.css.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { globalStyle, style } from "@vanilla-extract/css";
22
import { themeContract, vars } from "fluent-solid/lib/themes";
3-
import { appVars } from "~/themes/vars.css";
43

54
export const carousel = style({
6-
width: appVars.contentWidth,
75
height: "480px",
86
borderRadius: vars.borderRadiusMedium,
97
display: "flex",

src/components/Settings/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ import GithubMirror from "./GithubMirror";
77
import ThemesDirectory from "./ThemesDirectory";
88
import LockScreenWallpaperSwitch from "./LockScreenWallpaperSwitch";
99
import SettingsFooter from "./Footer";
10-
import { appVars } from "~/themes/vars.css";
1110

1211
const Settings = () => {
1312
return (
1413
<LazyFlex
1514
direction="column"
1615
style={{
17-
width: appVars.contentWidth,
18-
"box-sizing": "border-box",
16+
// width: appVars.contentWidth,
17+
// "box-sizing": "border-box",
1918
height: "100%",
19+
flex: 1,
2020
}}
2121
align="stretch"
2222
justify="stretch"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { style } from "@vanilla-extract/css";
22

33
export const sidebar = style({
4-
height: "560px",
4+
height: "100vh",
55
display: "flex",
66
flexDirection: "column",
77
});

src/components/Sidebar/SidebarButtons.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ const SidebarButtons = () => {
1616
};
1717

1818
return (
19-
<LazySpace direction="column" gap="s" justify="end" class={sidebarButtons}>
19+
<LazySpace
20+
direction="column"
21+
gap="s"
22+
justify="end"
23+
paddingBottom="m"
24+
paddingRight="10px"
25+
class={sidebarButtons}
26+
>
2027
<Show when={updateIsAvailable()}>
2128
<LazyTooltip
2229
positioning="after"

src/components/ThemeMenu/ThemeMenu.css.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { badge as fluentBadge } from "fluent-solid/lib/components/badge/Badge.cs
55
export const menuItemColorShadow = createVar();
66

77
export const thumbnailsContainer = style({
8-
flex: "7",
8+
flex: "1",
99
overflowY: "auto",
1010
overflowX: "hidden",
1111
padding: `${vars.spacingVerticalMNudge} ${vars.spacingHorizontalMNudge} ${vars.spacingVerticalMNudge} ${vars.spacingHorizontalXL}`,
@@ -19,8 +19,8 @@ export const menuItem = style({
1919
},
2020
padding: "4px",
2121
borderRadius: "5px",
22-
height: "64px",
23-
width: "64px",
22+
height: "72px",
23+
width: "72px",
2424
display: "flex",
2525
alignItems: "center",
2626
position: "relative",

src/components/ThemeMenu/ThemeMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const ThemeMenu = (props: ThemeMenuProps) => {
7171
class={styles.thumbnailsContainer}
7272
grow={7}
7373
shrink={1}
74-
padding="10px 10px 10px 24px"
74+
padding="10px"
7575
>
7676
{menu()}
7777
</LazyFlex>

src/index.css.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ globalStyle("*", {
2828
MozUserSelect: "none",
2929
WebkitUserSelect: "none",
3030
msUserSelect: "none",
31+
32+
margin: 0,
33+
padding: 0,
34+
boxSizing: "border-box",
3135
});
3236

3337
globalStyle("::-webkit-scrollbar", {
@@ -54,9 +58,8 @@ globalStyle("body", {
5458
});
5559

5660
globalStyle("#root", {
61+
display: "flex",
62+
padding: `${vars.spacingHorizontalXS} ${vars.spacingVerticalL} ${vars.spacingHorizontalL} ${vars.spacingHorizontalL}`,
5763
height: "100vh",
5864
width: "100vw",
59-
display: "flex",
60-
flexDirection: "column",
61-
overflow: "hidden",
6265
});

src/themes/vars.css.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)