diff --git a/blog.config.js b/blog.config.js index 80ff0dc1..330f1638 100644 --- a/blog.config.js +++ b/blog.config.js @@ -15,7 +15,7 @@ const BLOG = { notionPageId: process.env.NOTION_PAGE_ID || 'bee1fccfa3bd47a1a7be83cc71372d83', // Important page_id!!! notionAccessToken: process.env.NOTION_ACCESS_TOKEN || '', // Useful if you prefer not to make your database public appearance: 'auto', // ['light', 'dark', 'auto'], - font: 'font-sans tracking-wider subpixel-antialiased', // 文章字体 ['font-sans', 'font-serif', 'font-mono'] @see https://www.tailwindcss.cn/docs/font-family + font: 'font-serif tracking-wider subpixel-antialiased', // 文章字体 ['font-sans', 'font-serif', 'font-mono'] @see https://www.tailwindcss.cn/docs/font-family lightBackground: '#eeeeee', // use hex value, don't forget '#' e.g #fffefc darkBackground: '#111827', // use hex value, don't forget '#' path: '', // leave this empty unless you want to deploy in a folder diff --git a/components/ArticleDetail.js b/components/ArticleDetail.js index e8e75094..66245caa 100644 --- a/components/ArticleDetail.js +++ b/components/ArticleDetail.js @@ -113,7 +113,6 @@ export default function ArticleDetail ({ post, blockMap, recommendPosts, prev, n
{blockMap && ( - +
diff --git a/public/fonts/IBMPlexSansVar-Italic.woff2 b/public/fonts/IBMPlexSansVar-Italic.woff2 new file mode 100644 index 00000000..29b46d19 Binary files /dev/null and b/public/fonts/IBMPlexSansVar-Italic.woff2 differ diff --git a/public/fonts/IBMPlexSansVar-Roman.woff2 b/public/fonts/IBMPlexSansVar-Roman.woff2 new file mode 100644 index 00000000..c58615dd Binary files /dev/null and b/public/fonts/IBMPlexSansVar-Roman.woff2 differ diff --git a/public/fonts/SourceSerif-Italic.var.woff2 b/public/fonts/SourceSerif-Italic.var.woff2 new file mode 100644 index 00000000..24d617d0 Binary files /dev/null and b/public/fonts/SourceSerif-Italic.var.woff2 differ diff --git a/public/fonts/SourceSerif.var.woff2 b/public/fonts/SourceSerif.var.woff2 new file mode 100644 index 00000000..370649cf Binary files /dev/null and b/public/fonts/SourceSerif.var.woff2 differ diff --git a/styles/notion.css b/styles/notion.css index 951de56e..eace4c58 100644 --- a/styles/notion.css +++ b/styles/notion.css @@ -72,6 +72,7 @@ line-height: 1.5; color: var(--fg-color); caret-color: var(--fg-color); + font-family: inherit; } .notion > * { diff --git a/tailwind.config.js b/tailwind.config.js index 1d4cd847..565b54cc 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,9 +1,28 @@ const BLOG = require('./blog.config') - +const { fontFamily } = require('tailwindcss/defaultTheme') +const CJK = require('./lib/cjk') +const fontSansCJK = !CJK() + ? [] + : [`"Noto Sans CJK ${CJK()}"`, `"Noto Sans ${CJK()}"`] +const fontSerifCJK = !CJK() + ? [] + : [`"Noto Serif CJK ${CJK()}"`, `"Noto Serif ${CJK()}"`] module.exports = { purge: ['./pages/**/*.js', './components/**/*.js', './layouts/**/*.js'], darkMode: BLOG.appearance === 'class' ? 'media' : 'class', // or 'media' or 'class' theme: { + fontFamily: { + sans: ['"IBM Plex Sans"', ...fontFamily.sans, ...fontSansCJK], + serif: ['"Source Serif"', ...fontFamily.serif, ...fontSerifCJK], + noEmoji: [ + '"IBM Plex Sans"', + 'ui-sans-serif', + 'system-ui', + '-apple-system', + 'BlinkMacSystemFont', + 'sans-serif' + ] + }, extend: { colors: { day: {