From 08b610bbad3608f5b3aae939312417c7f2329d8c Mon Sep 17 00:00:00 2001 From: EYHN Date: Wed, 20 Mar 2024 16:45:14 +0000 Subject: [PATCH] fix(electron): menu item position on Mac when fullscreen (#6200) fix https://github.com/toeverything/AFFiNE/issues/6155 --- .../core/src/components/app-sidebar/index.css.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/frontend/core/src/components/app-sidebar/index.css.ts b/packages/frontend/core/src/components/app-sidebar/index.css.ts index 21850df038..cbfd81c9cd 100644 --- a/packages/frontend/core/src/components/app-sidebar/index.css.ts +++ b/packages/frontend/core/src/components/app-sidebar/index.css.ts @@ -1,5 +1,5 @@ import { cssVar } from '@toeverything/theme'; -import { style } from '@vanilla-extract/css'; +import { globalStyle, style } from '@vanilla-extract/css'; export const floatingMaxWidth = 768; export const navWrapperStyle = style({ zIndex: 3, @@ -42,12 +42,16 @@ export const navHeaderStyle = style({ justifyContent: 'space-between', alignItems: 'center', ['WebkitAppRegion' as string]: 'drag', - selectors: { - '&[data-is-macos-electron="true"]': { - paddingLeft: '90px', - }, - }, }); + +globalStyle( + `html[data-maximized="false"] + ${navHeaderStyle}[data-is-macos-electron="true"]`, + { + paddingLeft: '90px', + } +); + export const navBodyStyle = style({ flex: '1 1 auto', height: 'calc(100% - 52px)',