feat: new sidebar (app shell) styles (#2303)

This commit is contained in:
Peng Xiao
2023-05-12 11:13:51 +08:00
committed by LongYinan
parent add5deae0f
commit 683343ad82
54 changed files with 1166 additions and 642 deletions
@@ -1,4 +1,4 @@
import { style } from '@vanilla-extract/css';
import { globalStyle, style } from '@vanilla-extract/css';
import { breakpoints } from '../../styles/mui-theme';
export const appStyle = style({
@@ -13,6 +13,14 @@ export const appStyle = style({
'&[data-is-resizing="true"]': {
cursor: 'col-resize',
},
'&[data-noise-background="true"]:before': {
content: '""',
position: 'absolute',
inset: 0,
opacity: 'var(--affine-noise-opacity)',
backgroundSize: '25%',
backgroundImage: `url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.25' numOctaves='10' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`,
},
},
vars: {
'--affine-editor-width': '686px',
@@ -26,11 +34,35 @@ export const appStyle = style({
},
});
globalStyle(`html[data-theme="light"] ${appStyle}`, {
vars: {
'--affine-noise-opacity': '0.25',
},
});
globalStyle(`html[data-theme="dark"] ${appStyle}`, {
vars: {
'--affine-noise-opacity': '0.1',
},
});
export const mainContainerStyle = style({
position: 'relative',
flexGrow: 1,
maxWidth: '100%',
zIndex: 0,
backgroundColor: 'var(--affine-background-primary-color)',
selectors: {
'&[data-is-desktop="true"]': {
margin: '8px 8px 8px 8px',
borderRadius: '8px',
overflow: 'hidden',
boxShadow: 'var(--affine-shadow-1)',
},
'&[data-is-desktop="true"][data-is-sidebar-open="true"]': {
marginLeft: '2px',
},
},
});
export const toolStyle = style({