Skip to content

Commit c9532b4

Browse files
committed
feat: more styles for prism code block
1 parent 64d6b5f commit c9532b4

File tree

3 files changed

+16
-50
lines changed

3 files changed

+16
-50
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
"export": "npm run now-build && next export"
1212
},
1313
"dependencies": {
14-
"@zeit-ui/react": "^1.0.0-rc.9",
14+
"@zeit-ui/react": "^1.0.0-rc.11",
1515
"@zeit-ui/react-icons": "^1.2.1",
16+
"@zeit-ui/react-prism": "^1.0.0",
1617
"ms": "^2.1.2",
1718
"next": "^9.3.6",
1819
"react": "16.13.0",

pages/_app.jsx

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import Head from 'next/head'
22
import BLOG from '../blog.config'
3+
import { PrismBaseline } from '@zeit-ui/react-prism'
4+
import { ZEITUIProvider, CSSBaseline } from '@zeit-ui/react'
35
import React, { useCallback, useState, useEffect, useMemo } from 'react'
6+
import useDomClean from 'lib/use-dom-clean'
47
import { getDNSPrefetchValue } from 'lib/data-transform'
58
import ThemeConfigProvider from 'lib/components/theme-config-provider'
6-
import { ZEITUIProvider, useTheme, CSSBaseline } from '@zeit-ui/react'
7-
import useDomClean from 'lib/use-dom-clean'
89

910
const Application = ({ Component, pageProps }) => {
10-
const theme = useTheme()
1111
const [themeType, setThemeType] = useState('light')
1212
const domain = useMemo(() => getDNSPrefetchValue(BLOG.domain), [])
1313
const changeHandle = useCallback(isDark => {
@@ -46,52 +46,12 @@ const Application = ({ Component, pageProps }) => {
4646
<meta name="viewport" content="initial-scale=1, maximum-scale=5, minimum-scale=1, viewport-fit=cover" />
4747
</Head>
4848
<ZEITUIProvider theme={{ type: themeType }}>
49-
<CSSBaseline>
49+
<CSSBaseline />
50+
<PrismBaseline />
5051
<ThemeConfigProvider onChange={changeHandle}>
5152
<Component {...pageProps} />
5253
</ThemeConfigProvider>
53-
</CSSBaseline>
5454
<style global jsx>{`
55-
.tag {
56-
color: ${theme.palette.accents_5};
57-
}
58-
59-
.punctuation {
60-
color: ${theme.palette.accents_5};
61-
}
62-
63-
.attr-name {
64-
color: ${theme.palette.accents_6};
65-
}
66-
67-
.attr-value {
68-
color: ${theme.palette.accents_4};
69-
}
70-
71-
.language-javascript {
72-
color: ${theme.palette.accents_4};
73-
}
74-
75-
span[class*="class-name"] {
76-
color: ${theme.palette.purple};
77-
}
78-
79-
span.token.string {
80-
color: ${theme.palette.accents_5};
81-
}
82-
83-
span.keyword {
84-
color: ${theme.palette.success}
85-
}
86-
87-
span.plain-text {
88-
color: ${theme.palette.accents_3};
89-
}
90-
91-
body {
92-
overflow-x: hidden;
93-
}
94-
9555
@media only screen and (max-width: 767px) {
9656
html {
9757
font-size: 15px;

yarn.lock

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,10 +1308,15 @@
13081308
resolved "https://registry.yarnpkg.com/@zeit-ui/react-icons/-/react-icons-1.2.1.tgz#6e200adf6870aca0cd4a6e0d2ba5fb5196d53234"
13091309
integrity sha512-K0r7ZmqCB6Tl/tCmrjKXYuoWL9iMxUQem1lzUP/QCEJI+o0v5B0MnrEMzxrlXDFZDN/0wPjna0jcecQTL80GAA==
13101310

1311-
"@zeit-ui/react@^1.0.0-rc.9":
1312-
version "1.0.0-rc.9"
1313-
resolved "https://registry.yarnpkg.com/@zeit-ui/react/-/react-1.0.0-rc.9.tgz#be54410f99d05a7970ccded5403f565eeeee07cb"
1314-
integrity sha512-PRqlw5Ydhu88aV7/6vMPaFe7TCMnwlb4WPJ4BahNULRlnNrYOZ4DF4E50U3z7M8sE+OXFkywVz2jvJI3BZbd6Q==
1311+
"@zeit-ui/react-prism@^1.0.0":
1312+
version "1.0.0"
1313+
resolved "https://registry.yarnpkg.com/@zeit-ui/react-prism/-/react-prism-1.0.0.tgz#3438c648f71b7fc0d8a7c53a0cba90bc3dc2f784"
1314+
integrity sha512-gLGHCaVX7EM/dPl82GCVlLkpkA101cSK7gVnV0auQRHTiUq/Jeger87JbbQ+dJNSWH636sXiyErR0mwHpqHCUw==
1315+
1316+
"@zeit-ui/react@^1.0.0-rc.11":
1317+
version "1.0.0-rc.11"
1318+
resolved "https://registry.yarnpkg.com/@zeit-ui/react/-/react-1.0.0-rc.11.tgz#de6854b596cb0b1192835207d39f0424de85854a"
1319+
integrity sha512-6HhnL9TGAbMfPqts7rlcMkLLQgSwyzxnk/xa2eQ64AcuLj765zmyUFahvDT4z1ZKtGgYphESmt1feMjixwd/7A==
13151320
dependencies:
13161321
styled-jsx "^3.2.5"
13171322

0 commit comments

Comments
 (0)