From d013584a44c5c722ac1a05285248fa0a58c637d8 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 16 Jul 2019 09:23:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bnd2/react/src/styles/donate.js | 4 +++- bnd2/react/src/styles/font.js | 1 + bnd2/react/src/styles/index.js | 3 ++- bnd2/react/src/styles/utils.js | 4 +++- bnd2/react/src/withRoot.js | 4 ++++ 5 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 bnd2/react/src/styles/font.js diff --git a/bnd2/react/src/styles/donate.js b/bnd2/react/src/styles/donate.js index 3e8bc20..6fd8956 100644 --- a/bnd2/react/src/styles/donate.js +++ b/bnd2/react/src/styles/donate.js @@ -1,6 +1,8 @@ +import DEFAULT_FONT from './font' + export default { donate: { - fontFamily: 'Helvetica Neue,Luxi Sans,DejaVu Sans,Tahoma,Hiragino Sans GB,Microsoft Yahei,sans-serif', + fontFamily: DEFAULT_FONT, textAlign: 'center' }, donateImg: { diff --git a/bnd2/react/src/styles/font.js b/bnd2/react/src/styles/font.js new file mode 100644 index 0000000..151129f --- /dev/null +++ b/bnd2/react/src/styles/font.js @@ -0,0 +1 @@ +export default 'Helvetica Neue,Luxi Sans,DejaVu Sans,Tahoma,Hiragino Sans GB,Microsoft Yahei,sans-serif' \ No newline at end of file diff --git a/bnd2/react/src/styles/index.js b/bnd2/react/src/styles/index.js index cc86e63..a757b14 100644 --- a/bnd2/react/src/styles/index.js +++ b/bnd2/react/src/styles/index.js @@ -3,6 +3,7 @@ import list from './list' import utils from './utils' import donate from './donate' import welcome from './welcome' +import DEFAULT_FONT from './font' export default theme => ( Object.assign({ @@ -12,7 +13,7 @@ export default theme => ( width: '320px', }, content: { - fontFamily: 'Helvetica Neue,Luxi Sans,DejaVu Sans,Tahoma,Hiragino Sans GB,Microsoft Yahei,sans-serif', + fontFamily: DEFAULT_FONT, padding: '63px 24px 24px 24px', height: '100vh', position: 'absolute', diff --git a/bnd2/react/src/styles/utils.js b/bnd2/react/src/styles/utils.js index 787c1c0..f330014 100644 --- a/bnd2/react/src/styles/utils.js +++ b/bnd2/react/src/styles/utils.js @@ -1,3 +1,5 @@ +import DEFAULT_FONT from './font' + export default { fnHide: { display: 'none', @@ -57,7 +59,7 @@ export default { wordBreak: 'break-all', }, ftOriginal: { - fontFamily: 'Helvetica Neue,Luxi Sans,DejaVu Sans,Tahoma,Hiragino Sans GB,Microsoft Yahei,sans-serif', + fontFamily: DEFAULT_FONT, textDecoration: 'none', textTransform: 'inherit', '&:hover': { diff --git a/bnd2/react/src/withRoot.js b/bnd2/react/src/withRoot.js index 0e33bd1..b2fa633 100755 --- a/bnd2/react/src/withRoot.js +++ b/bnd2/react/src/withRoot.js @@ -1,6 +1,7 @@ import React from 'react'; import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'; import CssBaseline from '@material-ui/core/CssBaseline'; +import DEFAULT_FONT from './styles/font'; const theme = createMuiTheme({ palette: { @@ -15,6 +16,9 @@ const theme = createMuiTheme({ dark: '#932c22', }, }, + typography: { + fontFamily: DEFAULT_FONT + }, }); function withRoot(Component) { -- GitLab