mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-18 02:21:51 +08:00
chore: update shadow and color (#2171)
This commit is contained in:
@@ -9,7 +9,7 @@ export const StyledEditorModeSwitch = styled('div')<{
|
|||||||
height: '32px',
|
height: '32px',
|
||||||
background: showAlone
|
background: showAlone
|
||||||
? 'transparent'
|
? 'transparent'
|
||||||
: 'var(--affine-background-primary-color)',
|
: 'var(--affine-background-secondary-color)',
|
||||||
borderRadius: '12px',
|
borderRadius: '12px',
|
||||||
...displayFlex('space-between', 'center'),
|
...displayFlex('space-between', 'center'),
|
||||||
padding: '0 8px',
|
padding: '0 8px',
|
||||||
@@ -21,7 +21,7 @@ export const StyledEditorModeSwitch = styled('div')<{
|
|||||||
width: '24px',
|
width: '24px',
|
||||||
height: '24px',
|
height: '24px',
|
||||||
background: 'var(--affine-background-primary-color)',
|
background: 'var(--affine-background-primary-color)',
|
||||||
boxShadow: 'var(--affine-tooltip-shadow)',
|
boxShadow: 'var(--affine-shadow)',
|
||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
zIndex: 1,
|
zIndex: 1,
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
@@ -34,11 +34,12 @@ export const StyledEditorModeSwitch = styled('div')<{
|
|||||||
export const StyledSwitchItem = styled('button')<{
|
export const StyledSwitchItem = styled('button')<{
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
hide?: boolean;
|
hide?: boolean;
|
||||||
}>(({ theme, active = false, hide = false }) => {
|
}>(({ active = false, hide = false }) => {
|
||||||
return {
|
return {
|
||||||
width: '24px',
|
width: '24px',
|
||||||
height: '24px',
|
height: '24px',
|
||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
|
boxShadow: active ? 'var(--affine-shadow)' : 'none',
|
||||||
color: active ? 'var(--affine-primary-color)' : 'var(--affine-icon-color)',
|
color: active ? 'var(--affine-primary-color)' : 'var(--affine-icon-color)',
|
||||||
display: hide ? 'none' : 'inline-flex',
|
display: hide ? 'none' : 'inline-flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|||||||
@@ -47,32 +47,6 @@ export const StyleWorkspaceTitle = styled('div')(({ theme }) => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
export const StyledCard = styled('div')<{
|
|
||||||
active?: boolean;
|
|
||||||
}>(({ theme, active }) => {
|
|
||||||
const borderColor = active ? 'var(--affine-primary-color)' : 'transparent';
|
|
||||||
return {
|
|
||||||
width: '310px',
|
|
||||||
height: '124px',
|
|
||||||
cursor: 'pointer',
|
|
||||||
padding: '16px',
|
|
||||||
boxShadow: '0px 0px 8px rgba(0, 0, 0, 0.1)',
|
|
||||||
borderRadius: '12px',
|
|
||||||
border: `1px solid ${borderColor}`,
|
|
||||||
...displayFlex('flex-start', 'flex-start'),
|
|
||||||
marginBottom: '24px',
|
|
||||||
transition: 'background .2s',
|
|
||||||
background: 'var(--affine-background-primary-color)',
|
|
||||||
':hover': {
|
|
||||||
background: 'var(--affine-hover-color)',
|
|
||||||
'.add-icon': {
|
|
||||||
borderColor: 'var(--affine-primary-color)',
|
|
||||||
color: 'var(--affine-primary-color)',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
export const StyledFooter = styled('div')({
|
export const StyledFooter = styled('div')({
|
||||||
height: '84px',
|
height: '84px',
|
||||||
padding: '0 40px',
|
padding: '0 40px',
|
||||||
|
|||||||
@@ -47,9 +47,10 @@ export const StyledCreateWorkspaceCard = styled('div')(({ theme }) => {
|
|||||||
height: '124px',
|
height: '124px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
padding: '16px',
|
padding: '16px',
|
||||||
boxShadow: '0px 0px 8px rgba(0, 0, 0, 0.1)',
|
boxShadow: 'var(--affine-shadow)',
|
||||||
borderRadius: '12px',
|
borderRadius: '12px',
|
||||||
transition: 'all .1s',
|
transition: 'all .1s',
|
||||||
|
background: 'var(--affine-white-80)',
|
||||||
...displayFlex('flex-start', 'flex-start'),
|
...displayFlex('flex-start', 'flex-start'),
|
||||||
color: 'var(--affine-text-secondary-color)',
|
color: 'var(--affine-text-secondary-color)',
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ export const StyledCreateWorkspaceCard = styled('div')(({ theme }) => {
|
|||||||
background: 'var(--affine-hover-color)',
|
background: 'var(--affine-hover-color)',
|
||||||
color: 'var(--affine-text-primary-color)',
|
color: 'var(--affine-text-primary-color)',
|
||||||
'.add-icon': {
|
'.add-icon': {
|
||||||
borderColor: 'var(--affine-primary-color)',
|
borderColor: 'var(--affine-white-color)',
|
||||||
color: 'var(--affine-primary-color)',
|
color: 'var(--affine-primary-color)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -103,11 +104,13 @@ export const StyleWorkspaceAdd = styled('div')(() => {
|
|||||||
width: '58px',
|
width: '58px',
|
||||||
height: '58px',
|
height: '58px',
|
||||||
borderRadius: '100%',
|
borderRadius: '100%',
|
||||||
background: '#f4f5fa',
|
background: 'var(--affine-white-80)',
|
||||||
border: '1.5px dashed #f4f5fa',
|
border: '1.5px dashed #f4f5fa',
|
||||||
transition: 'background .2s',
|
transition: 'background .2s',
|
||||||
fontSize: '24px',
|
fontSize: '24px',
|
||||||
...displayFlex('center', 'center'),
|
...displayFlex('center', 'center'),
|
||||||
|
borderColor: 'var(--affine-white-color)',
|
||||||
|
color: 'var(--affine-primary-color)',
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
export const StyledModalHeader = styled('div')(() => {
|
export const StyledModalHeader = styled('div')(() => {
|
||||||
|
|||||||
@@ -123,7 +123,6 @@ export const WorkspaceCard: FC<WorkspaceCardProps> = ({
|
|||||||
</StyleWorkspaceInfo>
|
</StyleWorkspaceInfo>
|
||||||
<StyledSettingLink
|
<StyledSettingLink
|
||||||
className="setting-entry"
|
className="setting-entry"
|
||||||
hoverBackground="#fff"
|
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
onSettingClick(workspace);
|
onSettingClick(workspace);
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ export const StyledCard = styled('div')<{
|
|||||||
height: '124px',
|
height: '124px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
padding: '16px',
|
padding: '16px',
|
||||||
boxShadow: '0px 0px 8px rgba(0, 0, 0, 0.1)',
|
boxShadow: 'var(--affine-shadow)',
|
||||||
borderRadius: '12px',
|
borderRadius: '12px',
|
||||||
border: `1px solid ${borderColor}`,
|
border: `1px solid ${borderColor}`,
|
||||||
...displayFlex('flex-start', 'flex-start'),
|
...displayFlex('flex-start', 'flex-start'),
|
||||||
marginBottom: '24px',
|
marginBottom: '24px',
|
||||||
transition: 'background .2s',
|
transition: 'background .2s',
|
||||||
background: 'var(--affine-background-primary-color)',
|
background: 'var(--affine-white-80)',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
':hover': {
|
':hover': {
|
||||||
background: 'var(--affine-hover-color)',
|
background: 'var(--affine-hover-color)',
|
||||||
@@ -77,18 +77,18 @@ export const StyledModalHeader = styled('div')(() => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
export const StyledSettingLink = styled(IconButton)(({ theme }) => {
|
export const StyledSettingLink = styled(IconButton)(() => {
|
||||||
return {
|
return {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: '6px',
|
right: '6px',
|
||||||
bottom: '6px',
|
bottom: '6px',
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
borderRadius: '4px',
|
borderRadius: '4px',
|
||||||
color: 'var(--affine-background-primary-color)',
|
color: 'var(--affine-primary-color)',
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
transition: 'all .15s',
|
transition: 'all .15s',
|
||||||
':hover': {
|
':hover': {
|
||||||
background: 'var(--affine-background-primary-color)',
|
background: 'var(--affine-hover-color)',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export const StyledMenuWrapper = styled(StyledPopperContainer)<{
|
|||||||
padding: '8px 4px',
|
padding: '8px 4px',
|
||||||
fontSize: '14px',
|
fontSize: '14px',
|
||||||
backgroundColor: 'var(--affine-white)',
|
backgroundColor: 'var(--affine-white)',
|
||||||
boxShadow: 'var(--affine-popover-shadow)',
|
boxShadow: 'var(--affine-menu-shadow)',
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ export const ModalWrapper = styled('div')<{
|
|||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
minHeight,
|
minHeight,
|
||||||
backgroundColor: 'var(--affine-white)',
|
backgroundColor: 'var(--affine-background-secondary-color)',
|
||||||
|
boxShadow: 'var(--affine-popover-shadow)',
|
||||||
borderRadius: '16px',
|
borderRadius: '16px',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
maxHeight: 'calc(100vh - 32px)',
|
maxHeight: 'calc(100vh - 32px)',
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export const toast = (
|
|||||||
margin: 10px 0 0 0;
|
margin: 10px 0 0 0;
|
||||||
color: var(--affine-white);
|
color: var(--affine-white);
|
||||||
background: var(--affine-tooltip);
|
background: var(--affine-tooltip);
|
||||||
box-shadow: var(--affine-tooltip-shadow);
|
box-shadow: var(--affine-float-button-shadow);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
transition: all 230ms cubic-bezier(0.21, 1.02, 0.73, 1);
|
transition: all 230ms cubic-bezier(0.21, 1.02, 0.73, 1);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ import type { TooltipProps } from '@mui/material';
|
|||||||
import { css, displayFlex, styled } from '../../styles';
|
import { css, displayFlex, styled } from '../../styles';
|
||||||
import { Popper, type PopperProps } from '../popper';
|
import { Popper, type PopperProps } from '../popper';
|
||||||
import StyledPopperContainer from '../shared/Container';
|
import StyledPopperContainer from '../shared/Container';
|
||||||
const StyledTooltip = styled(StyledPopperContainer)(({ theme }) => {
|
const StyledTooltip = styled(StyledPopperContainer)(() => {
|
||||||
return {
|
return {
|
||||||
width: '390px',
|
width: '390px',
|
||||||
minHeight: '92px',
|
minHeight: '92px',
|
||||||
boxShadow: 'var(--affine-tooltip-shadow)',
|
|
||||||
padding: '12px',
|
padding: '12px',
|
||||||
backgroundColor: 'var(--affine-background-tertiary-color)',
|
backgroundColor: 'var(--affine-tertiary-color)',
|
||||||
transform: 'all 0.15s',
|
transform: 'all 0.15s',
|
||||||
color: 'var(--affine-text-emphasis-color)',
|
color: 'var(--affine-text-emphasis-color)',
|
||||||
...displayFlex('center', 'center'),
|
...displayFlex('center', 'center'),
|
||||||
@@ -20,7 +19,7 @@ const StyledTooltip = styled(StyledPopperContainer)(({ theme }) => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const StyledCircleContainer = styled('div')(({ theme }) => {
|
const StyledCircleContainer = styled('div')(() => {
|
||||||
return css`
|
return css`
|
||||||
position: relative;
|
position: relative;
|
||||||
content: '';
|
content: '';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import StyledPopperContainer from '../shared/Container';
|
|||||||
const StyledTooltip = styled(StyledPopperContainer)(({ theme }) => {
|
const StyledTooltip = styled(StyledPopperContainer)(({ theme }) => {
|
||||||
return {
|
return {
|
||||||
maxWidth: '320px',
|
maxWidth: '320px',
|
||||||
boxShadow: 'var(--affine-popover-shadow)',
|
boxShadow: 'var(--affine-float-button-shadow)',
|
||||||
padding: '4px 12px',
|
padding: '4px 12px',
|
||||||
backgroundColor: 'var(--affine-tooltip)',
|
backgroundColor: 'var(--affine-tooltip)',
|
||||||
color: 'var(--affine-white)',
|
color: 'var(--affine-white)',
|
||||||
|
|||||||
@@ -28,12 +28,6 @@ const basicFontFamily =
|
|||||||
'apple-system, BlinkMacSystemFont,Helvetica Neue, Tahoma, PingFang SC, Microsoft Yahei, Arial,Hiragino Sans GB, sans-serif, Apple Color Emoji, Segoe UI Emoji,Segoe UI Symbol, Noto Color Emoji';
|
'apple-system, BlinkMacSystemFont,Helvetica Neue, Tahoma, PingFang SC, Microsoft Yahei, Arial,Hiragino Sans GB, sans-serif, Apple Color Emoji, Segoe UI Emoji,Segoe UI Symbol, Noto Color Emoji';
|
||||||
|
|
||||||
export const baseTheme = {
|
export const baseTheme = {
|
||||||
// shadow
|
|
||||||
popoverShadow:
|
|
||||||
'0px 1px 10px -6px rgba(24, 39, 75, 0.08), 0px 3px 16px -6px rgba(24, 39, 75, 0.04)',
|
|
||||||
modalShadow: '0px 4px 24px #161616',
|
|
||||||
tooltipShadow: '0px 0px 4px rgba(0, 0, 0, 0.14)',
|
|
||||||
|
|
||||||
// font
|
// font
|
||||||
fontFamily: `Avenir Next, Poppins, ${basicFontFamily}`,
|
fontFamily: `Avenir Next, Poppins, ${basicFontFamily}`,
|
||||||
fontNumberFamily: `Roboto Mono, ${basicFontFamily}`,
|
fontNumberFamily: `Roboto Mono, ${basicFontFamily}`,
|
||||||
@@ -146,6 +140,13 @@ export const lightTheme = {
|
|||||||
paletteShapeBlack: 'rgb(0, 0, 0)',
|
paletteShapeBlack: 'rgb(0, 0, 0)',
|
||||||
paletteShapeGrey: 'rgb(194, 194, 194)',
|
paletteShapeGrey: 'rgb(194, 194, 194)',
|
||||||
tooltip: '#424149',
|
tooltip: '#424149',
|
||||||
|
menuShadow:
|
||||||
|
'0px 0px 12px rgba(66, 65, 73, 0.1), inset 0px 0px 0px 0.5px rgba(227, 227, 228, 1)',
|
||||||
|
shadow: '0px 0px 4px rgba(66, 65, 73, 0.1)',
|
||||||
|
popoverShadow:
|
||||||
|
'0px 0px 24px rgba(0, 0, 0, 0.2), 0px 0px 4px rgba(0, 0, 0, 0.6), inset 0px 0px 0px 1px rgba(227, 226, 228, 1)',
|
||||||
|
floatButtonShadow:
|
||||||
|
'0px 1px 16px rgba(0, 0, 0, 0.1), 0px 2px 3px rgba(0, 0, 0, 0.1)',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const darkTheme = {
|
export const darkTheme = {
|
||||||
@@ -153,8 +154,8 @@ export const darkTheme = {
|
|||||||
|
|
||||||
themeMode: 'dark',
|
themeMode: 'dark',
|
||||||
|
|
||||||
brandColor: 'rgb(84, 56, 255)',
|
brandColor: 'rgba(156, 140, 255, 1)',
|
||||||
primaryColor: 'rgba(106, 86, 229, 1)',
|
primaryColor: 'rgba(156, 140, 255, 1)',
|
||||||
secondaryColor: 'rgb(144, 150, 245)',
|
secondaryColor: 'rgb(144, 150, 245)',
|
||||||
tertiaryColor: 'rgb(30, 30, 30)',
|
tertiaryColor: 'rgb(30, 30, 30)',
|
||||||
hoverColor: 'rgba(255, 255, 255, 0.1)',
|
hoverColor: 'rgba(255, 255, 255, 0.1)',
|
||||||
@@ -170,7 +171,7 @@ export const darkTheme = {
|
|||||||
warningColor: 'rgb(255, 123, 77)',
|
warningColor: 'rgb(255, 123, 77)',
|
||||||
errorColor: 'rgb(212, 140, 130)',
|
errorColor: 'rgb(212, 140, 130)',
|
||||||
processingColor: 'rgb(195, 215, 255)',
|
processingColor: 'rgb(195, 215, 255)',
|
||||||
textEmphasisColor: 'rgb(208, 205, 220)',
|
textEmphasisColor: 'rgba(156, 140, 255, 1)',
|
||||||
textPrimaryColor: 'rgb(234, 234, 234)',
|
textPrimaryColor: 'rgb(234, 234, 234)',
|
||||||
textSecondaryColor: 'rgb(156, 156, 160)',
|
textSecondaryColor: 'rgb(156, 156, 160)',
|
||||||
textDisableColor: 'rgb(119, 117, 125)',
|
textDisableColor: 'rgb(119, 117, 125)',
|
||||||
@@ -233,6 +234,13 @@ export const darkTheme = {
|
|||||||
paletteShapeBlack: 'rgb(0, 0, 0)',
|
paletteShapeBlack: 'rgb(0, 0, 0)',
|
||||||
paletteShapeGrey: 'rgb(194, 194, 194)',
|
paletteShapeGrey: 'rgb(194, 194, 194)',
|
||||||
tooltip: '#EAEAEA',
|
tooltip: '#EAEAEA',
|
||||||
|
menuShadow:
|
||||||
|
'0px 0px 12px rgba(0, 0, 0, 1), inset 0px 0px 0px 0.5px rgba(46, 46, 46, 1)',
|
||||||
|
shadow: '0px 0px 4px rgba(20, 20, 20, 1)',
|
||||||
|
popoverShadow:
|
||||||
|
'0px 0px 26px rgba(0, 0, 0, 0.8), 0px 0px 10px rgba(0, 0, 0, 1), inset 0px 0px 0px 1px rgba(46, 46, 46, 1)',
|
||||||
|
floatButtonShadow:
|
||||||
|
'0px 1px 16px rgba(0, 0, 0, 1), 0px 2px 3px rgba(0, 0, 0, 1)',
|
||||||
} satisfies Omit<AffineTheme, 'editorMode'>;
|
} satisfies Omit<AffineTheme, 'editorMode'>;
|
||||||
|
|
||||||
export const lightCssVariables = Object.entries(lightTheme).reduce(
|
export const lightCssVariables = Object.entries(lightTheme).reduce(
|
||||||
|
|||||||
Reference in New Issue
Block a user