fix: some style issues to sidebar and switch (#4046)

Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
Peng Xiao
2023-08-31 20:46:06 +08:00
committed by GitHub
parent 260c25acf3
commit 13857d59dc
16 changed files with 91 additions and 55 deletions

View File

@@ -49,7 +49,7 @@ export const fontStyleOptions = [
}[];
const appSettingBaseAtom = atomWithStorage<AppSetting>('affine-settings', {
clientBorder: globalThis.platform !== 'win32',
clientBorder: environment.isDesktop ? !environment.isWindows : false,
fullWidthLayout: false,
windowFrameStyle: 'frameless',
fontStyle: 'Sans',

View File

@@ -11,7 +11,11 @@ export const AppContainer = (props: WorkspaceRootProps) => {
return (
<AppContainerWithoutSettings
useNoisyBackground={appSettings.enableNoisyBackground}
useBlurBackground={!appSettings.enableBlurBackground}
useBlurBackground={
appSettings.enableBlurBackground &&
environment.isDesktop &&
environment.isMacOs
}
{...props}
/>
);

View File

@@ -212,17 +212,19 @@ export const AppearanceSettings = () => {
}
/>
</SettingRow>
<SettingRow
name={t['com.affine.settings.translucent-style']()}
desc={t['com.affine.settings.translucent-style-description']()}
>
<Switch
checked={appSettings.enableBlurBackground}
onChange={checked =>
changeSwitch('enableBlurBackground', checked)
}
/>
</SettingRow>
{environment.isMacOs && (
<SettingRow
name={t['com.affine.settings.translucent-style']()}
desc={t['com.affine.settings.translucent-style-description']()}
>
<Switch
checked={appSettings.enableBlurBackground}
onChange={checked =>
changeSwitch('enableBlurBackground', checked)
}
/>
</SettingRow>
)}
</SettingWrapper>
) : null}
</>

View File

@@ -123,8 +123,8 @@ globalStyle(`${accountButton} .avatar.not-sign`, {
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
borderColor: 'var(--affine-border-color)',
color: 'var(--affine-border-color)',
borderColor: 'var(--affine-icon-secondary)',
color: 'var(--affine-icon-secondary)',
background: 'var(--affine-white)',
});
globalStyle(`${accountButton} .content`, {

View File

@@ -1,4 +1,3 @@
import { Wrapper } from '@affine/component';
import {
appSidebarFloatingAtom,
appSidebarOpenAtom,
@@ -66,12 +65,8 @@ export const Header = forwardRef<HTMLDivElement, HeaderPros>(function Header(
})}
>
<div className={clsx(style.headerItem, 'top-item')}>
<div ref={sidebarSwitchRef}>
{!open && (
<Wrapper marginRight={20}>
<SidebarSwitch />
</Wrapper>
)}
<div ref={sidebarSwitchRef} style={{ marginRight: open ? 0 : 20 }}>
<SidebarSwitch show={!open} />
</div>
</div>
<div className={clsx(style.headerItem, 'left')}>

View File

@@ -77,10 +77,10 @@ export const collapsibleContent = style({
marginTop: '4px',
selectors: {
'&[data-state="open"]': {
animation: `${slideDown} 0.2s ease-out`,
animation: `${slideDown} 0.2s ease-in-out`,
},
'&[data-state="closed"]': {
animation: `${slideUp} 0.2s ease-out`,
animation: `${slideUp} 0.2s ease-in-out`,
},
},
});

View File

@@ -155,7 +155,13 @@ export const RootAppSidebar = ({
<>
<AppSidebar
router={router}
hasBackground={!appSettings.enableBlurBackground}
hasBackground={
!(
appSettings.enableBlurBackground &&
environment.isDesktop &&
environment.isMacOs
)
}
>
<SidebarContainer>
<NoSsr>