Files
supabase/apps/www/components/Contribute/markdownComponents.tsx
Ivan VasilovandJordi Enric 56de26fe22 chore: Migrate the monorepo to use Tailwind v4 (#45318)
This PR migrates the whole monorepo to use Tailwind v4:
- Removed `@tailwindcss/container-queries` plugin since it's included by
default in v4,
- Bump all instances of Tailwind to v4. Made minimal changes to the
shared config to remove non-supported features (`alpha` mentions),
- Migrate all apps to be compatible with v4 configs,
- Fix the `typography.css` import in 3 apps,
- Add missing rules which were included by default in v3,
- Run `pnpm dlx @tailwindcss/upgrade` on all apps, which renames a lot
of classes
- Rename all misnamed classes according to
https://tailwindcss.com/docs/upgrade-guide#renamed-utilities in all
apps.

---------

Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-04-30 10:53:24 +00:00

31 lines
1002 B
TypeScript

import type { Components } from 'react-markdown'
export const markdownComponents: Components = {
code: ({ className, ...props }) =>
className ? (
<code {...props} className="font-mono text-sm whitespace-pre block min-w-0" />
) : (
<code
{...props}
className="bg-surface-200 text-foreground px-1.5 py-0.5 rounded-sm text-sm font-mono"
/>
),
pre: ({ node, ...props }) => (
<pre
{...props}
className="bg-surface-200 text-foreground p-4 rounded-lg mb-3 w-full min-w-0 overflow-x-auto"
/>
),
a: ({ node, ...props }) => (
<a
{...props}
className="text-brand-link hover:underline break-all"
target="_blank"
rel="noopener noreferrer"
/>
),
p: ({ node, ...props }) => <p {...props} className="mb-3 last:mb-0" />,
ul: ({ node, ...props }) => <ul {...props} className="list-disc pl-5 space-y-1 mb-3" />,
ol: ({ node, ...props }) => <ol {...props} className="list-decimal pl-5 space-y-1 mb-3" />,
}