feat: modify styles

This commit is contained in:
QiShaoXuan
2022-10-21 16:55:29 +08:00
parent c47c7d2c4a
commit 8a2a3e2c4c
7 changed files with 50 additions and 16 deletions
+1 -1
View File
@@ -17,7 +17,7 @@
"@emotion/react": "^11.10.4", "@emotion/react": "^11.10.4",
"@emotion/server": "^11.10.0", "@emotion/server": "^11.10.0",
"@emotion/styled": "^11.10.4", "@emotion/styled": "^11.10.4",
"@fontsource/roboto-mono": "^4.5.8", "@fontsource/space-mono": "^4.5.10",
"@mui/base": "^5.0.0-alpha.87", "@mui/base": "^5.0.0-alpha.87",
"@mui/icons-material": "^5.10.9", "@mui/icons-material": "^5.10.9",
"@mui/material": "^5.8.6", "@mui/material": "^5.8.6",
@@ -14,7 +14,7 @@ export const StyledModalContainer = styled('div')(({ theme }) => {
export const StyledModalWrapper = styled('div')(({ theme }) => { export const StyledModalWrapper = styled('div')(({ theme }) => {
return { return {
width: '860px', width: '860px',
height: '626px', height: '540px',
backgroundColor: theme.colors.popoverBackground, backgroundColor: theme.colors.popoverBackground,
backgroundImage: `url(${bg.src})`, backgroundImage: `url(${bg.src})`,
borderRadius: '20px', borderRadius: '20px',
@@ -112,7 +112,6 @@ export const StyledSmallLink = styled('a')(({ theme }) => {
}); });
export const StyledSubTitle = styled('div')(({ theme }) => { export const StyledSubTitle = styled('div')(({ theme }) => {
return { return {
width: '189px',
fontSize: '18px', fontSize: '18px',
fontWeight: '600', fontWeight: '600',
color: theme.colors.textColor, color: theme.colors.textColor,
@@ -121,10 +120,13 @@ export const StyledSubTitle = styled('div')(({ theme }) => {
}); });
export const StyledLeftContainer = styled('div')({ export const StyledLeftContainer = styled('div')({
width: '320px',
flexDirection: 'column', flexDirection: 'column',
...displayFlex('space-between', 'center'), ...displayFlex('space-between', 'center'),
}); });
export const StyledRightContainer = styled('div')({ export const StyledRightContainer = styled('div')({
width: '214px',
flexShrink: '0',
flexDirection: 'column', flexDirection: 'column',
...displayFlex('center', 'flex-end'), ...displayFlex('center', 'flex-end'),
}); });
@@ -132,10 +134,11 @@ export const StyledRightContainer = styled('div')({
export const StyledContent = styled('div')({ export const StyledContent = styled('div')({
height: '276px', height: '276px',
width: '100%', width: '100%',
padding: '0 145px', padding: '0 140px',
...displayFlex('space-between', 'center'), ...displayFlex('space-between', 'center'),
color: '#3A4C5C', color: '#3A4C5C',
marginTop: '100px', marginTop: '58px',
letterSpacing: '0.06em',
}); });
export const StyledBackdrop = styled('div')(({ theme }) => { export const StyledBackdrop = styled('div')(({ theme }) => {
@@ -148,8 +151,8 @@ export const StyledLogo = styled('img')({
export const StyledModalHeader = styled('div')(({ theme }) => { export const StyledModalHeader = styled('div')(({ theme }) => {
return { return {
height: '30px', height: '20px',
marginTop: '54px', marginTop: '36px',
padding: '0 48px', padding: '0 48px',
...displayFlex('space-between', 'center'), ...displayFlex('space-between', 'center'),
}; };
@@ -197,10 +200,16 @@ export const StyledModalFooter = styled('div')(({ theme }) => {
textAlign: 'center', textAlign: 'center',
color: theme.colors.textColor, color: theme.colors.textColor,
marginTop: '75px', marginTop: '40px',
'p:first-of-type': { 'p:first-of-type': {
color: theme.colors.primaryColor, color: theme.colors.primaryColor,
marginBottom: '10px', letterSpacing: '0.06em',
marginBottom: '25px',
a: {
':visited': {
color: theme.colors.linkColor,
},
},
}, },
}; };
}); });
@@ -30,8 +30,13 @@ export const StyledAnimateRadioContainer = styled('div')<{ shrink: boolean }>(
background: theme.colors.hoverBackground, background: theme.colors.hoverBackground,
position: 'relative', position: 'relative',
display: 'flex', display: 'flex',
transition: `background ${ANIMATE_DURATION}ms`, transition: `background ${ANIMATE_DURATION}ms, border ${ANIMATE_DURATION}ms`,
border: '1px solid transparent',
...shrinkStyle, ...shrinkStyle,
':hover': {
border: `1px solid ${theme.colors.primaryColor}`,
},
}; };
} }
); );
+1 -1
View File
@@ -7,7 +7,7 @@ import { EditorProvider } from '@/components/editor-provider';
import { ModalProvider } from '@/components/global-modal-provider'; import { ModalProvider } from '@/components/global-modal-provider';
import { Logger } from '@toeverything/pathfinder-logger'; import { Logger } from '@toeverything/pathfinder-logger';
import '@fontsource/roboto-mono'; import "@fontsource/space-mono";
const ThemeProvider = dynamic(() => import('@/styles/themeProvider'), { const ThemeProvider = dynamic(() => import('@/styles/themeProvider'), {
ssr: false, ssr: false,
+11 -1
View File
@@ -23,13 +23,15 @@ export const lightTheme: AffineTheme = {
quoteColor: '#4C6275', quoteColor: '#4C6275',
placeHolderColor: '#C7C7C7', placeHolderColor: '#C7C7C7',
selectedColor: 'rgba(104, 128, 255, 0.1)', selectedColor: 'rgba(104, 128, 255, 0.1)',
borderColor: '#D0D7E3',
}, },
font: { font: {
xs: '12px', xs: '12px',
sm: '16px', sm: '16px',
base: '18px', base: '18px',
family: `Avenir Next, ${basicFontFamily}`, family: `Avenir Next, ${basicFontFamily}`,
family2: `Roboto Mono, ${basicFontFamily}`, family2: `Space Mono, ${basicFontFamily}`,
lineHeightBase: '26px',
}, },
zIndex: { zIndex: {
modal: 1000, modal: 1000,
@@ -41,6 +43,9 @@ export const lightTheme: AffineTheme = {
modal: modal:
'4px 4px 7px rgba(58, 76, 92, 0.04), -4px -4px 13px rgba(58, 76, 92, 0.02), 6px 6px 36px rgba(58, 76, 92, 0.06);', '4px 4px 7px rgba(58, 76, 92, 0.04), -4px -4px 13px rgba(58, 76, 92, 0.02), 6px 6px 36px rgba(58, 76, 92, 0.06);',
}, },
space: {
paragraph: '18px',
},
}; };
export const darkTheme: AffineTheme = { export const darkTheme: AffineTheme = {
@@ -63,6 +68,7 @@ export const darkTheme: AffineTheme = {
quoteColor: '#A9B1C6', quoteColor: '#A9B1C6',
placeHolderColor: '#C7C7C7', placeHolderColor: '#C7C7C7',
selectedColor: 'rgba(240, 242, 255, 0.8)', selectedColor: 'rgba(240, 242, 255, 0.8)',
borderColor: '#4D4C53',
}, },
shadow: { shadow: {
popover: popover:
@@ -95,6 +101,7 @@ export const globalThemeVariables: (
'--affine-quote-color': theme.colors.quoteColor, '--affine-quote-color': theme.colors.quoteColor,
'--affine-selected-color': theme.colors.selectedColor, '--affine-selected-color': theme.colors.selectedColor,
'--affine-placeholder-color': theme.colors.placeHolderColor, '--affine-placeholder-color': theme.colors.placeHolderColor,
'--affine-border-color': theme.colors.borderColor,
'--affine-modal-shadow': theme.shadow.modal, '--affine-modal-shadow': theme.shadow.modal,
'--affine-popover-shadow': theme.shadow.popover, '--affine-popover-shadow': theme.shadow.popover,
@@ -102,11 +109,14 @@ export const globalThemeVariables: (
'--affine-font-xs': theme.font.xs, // tiny '--affine-font-xs': theme.font.xs, // tiny
'--affine-font-sm': theme.font.sm, // small '--affine-font-sm': theme.font.sm, // small
'--affine-font-base': theme.font.base, '--affine-font-base': theme.font.base,
'--affine-line-height-base': theme.font.lineHeightBase,
'--affine-z-index-modal': theme.zIndex.modal, '--affine-z-index-modal': theme.zIndex.modal,
'--affine-z-index-popover': theme.zIndex.popover, '--affine-z-index-popover': theme.zIndex.popover,
'--affine-font-family': theme.font.family, '--affine-font-family': theme.font.family,
'--affine-font-family2': theme.font.family2, '--affine-font-family2': theme.font.family2,
'--affine-paragraph-space': theme.space.paragraph,
}; };
}; };
+10
View File
@@ -31,6 +31,7 @@ export interface AffineTheme {
quoteColor: string; quoteColor: string;
placeHolderColor: string; placeHolderColor: string;
selectedColor: string; selectedColor: string;
borderColor: string;
}; };
font: { font: {
xs: string; // tiny xs: string; // tiny
@@ -39,6 +40,8 @@ export interface AffineTheme {
family: string; family: string;
family2: string; family2: string;
lineHeightBase: string | number;
}; };
zIndex: { zIndex: {
modal: number; modal: number;
@@ -48,6 +51,9 @@ export interface AffineTheme {
modal: string; modal: string;
popover: string; popover: string;
}; };
space: {
paragraph: string;
};
} }
export interface AffineThemeCSSVariables { export interface AffineThemeCSSVariables {
@@ -68,6 +74,7 @@ export interface AffineThemeCSSVariables {
'--affine-quote-color': AffineTheme['colors']['quoteColor']; '--affine-quote-color': AffineTheme['colors']['quoteColor'];
'--affine-placeholder-color': AffineTheme['colors']['placeHolderColor']; '--affine-placeholder-color': AffineTheme['colors']['placeHolderColor'];
'--affine-selected-color': AffineTheme['colors']['selectedColor']; '--affine-selected-color': AffineTheme['colors']['selectedColor'];
'--affine-border-color': AffineTheme['colors']['borderColor'];
'--affine-modal-shadow': AffineTheme['shadow']['popover']; '--affine-modal-shadow': AffineTheme['shadow']['popover'];
'--affine-popover-shadow': AffineTheme['shadow']['modal']; '--affine-popover-shadow': AffineTheme['shadow']['modal'];
@@ -75,12 +82,15 @@ export interface AffineThemeCSSVariables {
'--affine-font-xs': AffineTheme['font']['xs']; // tiny '--affine-font-xs': AffineTheme['font']['xs']; // tiny
'--affine-font-sm': AffineTheme['font']['sm']; // small '--affine-font-sm': AffineTheme['font']['sm']; // small
'--affine-font-base': AffineTheme['font']['base']; '--affine-font-base': AffineTheme['font']['base'];
'--affine-line-height-base': AffineTheme['font']['lineHeightBase'];
'--affine-z-index-modal': AffineTheme['zIndex']['modal']; '--affine-z-index-modal': AffineTheme['zIndex']['modal'];
'--affine-z-index-popover': AffineTheme['zIndex']['popover']; '--affine-z-index-popover': AffineTheme['zIndex']['popover'];
'--affine-font-family': AffineTheme['font']['family']; '--affine-font-family': AffineTheme['font']['family'];
'--affine-font-family2': AffineTheme['font']['family2']; '--affine-font-family2': AffineTheme['font']['family2'];
'--affine-paragraph-space': AffineTheme['space']['paragraph'];
} }
declare module '@emotion/react' { declare module '@emotion/react' {
+4 -4
View File
@@ -25,7 +25,7 @@ importers:
'@emotion/react': ^11.10.4 '@emotion/react': ^11.10.4
'@emotion/server': ^11.10.0 '@emotion/server': ^11.10.0
'@emotion/styled': ^11.10.4 '@emotion/styled': ^11.10.4
'@fontsource/roboto-mono': ^4.5.8 '@fontsource/space-mono': ^4.5.10
'@mui/base': ^5.0.0-alpha.87 '@mui/base': ^5.0.0-alpha.87
'@mui/icons-material': ^5.10.9 '@mui/icons-material': ^5.10.9
'@mui/material': ^5.8.6 '@mui/material': ^5.8.6
@@ -55,7 +55,7 @@ importers:
'@emotion/react': 11.10.4_w5j4k42lgipnm43s3brx6h3c34 '@emotion/react': 11.10.4_w5j4k42lgipnm43s3brx6h3c34
'@emotion/server': 11.10.0_@emotion+css@11.10.0 '@emotion/server': 11.10.0_@emotion+css@11.10.0
'@emotion/styled': 11.10.4_yiaqs725o7pcd7rteavrnhgj4y '@emotion/styled': 11.10.4_yiaqs725o7pcd7rteavrnhgj4y
'@fontsource/roboto-mono': 4.5.8 '@fontsource/space-mono': 4.5.10
'@mui/base': 5.0.0-alpha.101_7ey2zzynotv32rpkwno45fsx4e '@mui/base': 5.0.0-alpha.101_7ey2zzynotv32rpkwno45fsx4e
'@mui/icons-material': 5.10.9_5fncb4nagb4cvvcnwamw2rozfa '@mui/icons-material': 5.10.9_5fncb4nagb4cvvcnwamw2rozfa
'@mui/material': 5.10.9_af5ln35zuaotaffazii6n6bke4 '@mui/material': 5.10.9_af5ln35zuaotaffazii6n6bke4
@@ -379,8 +379,8 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@fontsource/roboto-mono/4.5.8: /@fontsource/space-mono/4.5.10:
resolution: {integrity: sha512-AW44UkbQD0w1CT5mzDbsvhGZ6/bb0YmZzoELj6Sx8vcVEzcbYGUdt2Dtl5zqlOuYMWQFY1mniwWyVv+Bm/lVxw==} resolution: {integrity: sha512-OTrWNdcPp01bZjEbSu52vMu9PaReUFylHAMI4lctKVbYUnm+e7a4eG6YcnRvDrJEMYHBDtEWLAsqGVldV5r1EQ==}
dev: false dev: false
/@humanwhocodes/config-array/0.10.4: /@humanwhocodes/config-array/0.10.4: