Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit edc879f

Browse files
committed
Change typography styles for links and code
1 parent 3153b15 commit edc879f

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

src/components/ui/toggle/Toggle.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { useEffect, useState } from 'react'
66
export default function Toggle() {
77
const { theme, setTheme } = useTheme()
88
const [enabled, setEnabled] = useState(theme === 'light' ? false : true)
9-
console.log(theme)
109

1110
useEffect(() => {
1211
if (enabled) {

src/styles/globals.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,30 @@
2323
p {
2424
@apply text-black;
2525
}
26+
27+
/* Removes ` and ` for inline codes */
28+
code::before {
29+
content: none !important;
30+
}
31+
32+
code::after {
33+
content: none !important;
34+
}
35+
36+
/* For inline code */
37+
code {
38+
font-size: 80% !important;
39+
}
40+
41+
code {
42+
@apply bg-gray-100 text-black;
43+
}
44+
45+
/* For code blocks */
46+
pre > code {
47+
font-size: 90% !important;
48+
}
49+
50+
.prose > a {
51+
@apply text-brand-600;
52+
}

tailwind.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ module.exports = {
3030
normal: colors.gray,
3131
lightSurface: 'hsl(210, 20%, 98%)',
3232
},
33+
typography: (theme) => ({
34+
DEFAULT: {
35+
css: {
36+
code: {
37+
// For inline codes
38+
// Ex: `Coderplex`
39+
padding: '3px 5px',
40+
borderRadius: 5,
41+
},
42+
},
43+
},
44+
}),
3345
},
3446
},
3547
variants: {},

0 commit comments

Comments
 (0)