Skip to content

Commit

Permalink
πŸ’„ Update inline code blocks style (#1556)
Browse files Browse the repository at this point in the history
* ✨ Remove `defaultLang` from `rehypePrettyCode`

* πŸ’„ Add styles for `code` block in theme

* ✨ Disable `typography` `pre` & `code` styling
  • Loading branch information
carloscuesta authored Oct 28, 2024
1 parent 364bfbe commit 9965e18
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const withMDX = createMDX({
dark,
light,
},
defaultLang: 'plaintext',
},
],
[rehypeWrap, { selector: 'table', wrapper: 'div.responsiveTable' }],
Expand Down
4 changes: 4 additions & 0 deletions src/utils/theme/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ html {
@apply underline;
}

code {
@apply text-sm py-[1px] px-1 inline-block rounded-md border bg-neutral-50 text-neutral-800 dark:bg-neutral-900 dark:border-neutral-700 dark:text-white;
}

code[data-theme],
pre[data-theme] {
white-space: pre;
Expand Down
8 changes: 8 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ module.exports = {
animation: {
wave: 'wave 1.2s ease infinite',
},
typography: {
DEFAULT: {
css: {
pre: false,
code: false,
},
},
},
},
},
plugins: [require('@tailwindcss/typography')],
Expand Down

0 comments on commit 9965e18

Please sign in to comment.