Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Links styling (#20199)

Francesco Sansalvadoreb8ffc4faf8df
diff --git a/apps/www/lib/mdx/mdxComponents.tsx b/apps/www/lib/mdx/mdxComponents.tsx
index 323285bf023..e9a4079bcd4 100644
--- a/apps/www/lib/mdx/mdxComponents.tsx
+++ b/apps/www/lib/mdx/mdxComponents.tsx
@@ -2,9 +2,6 @@ import 'react-medium-image-zoom/dist/styles.css'
import { PropsWithChildren } from 'react'
import Image from 'next/image'
-import { useRouter } from 'next/router'
-import CopyToClipboard from 'react-copy-to-clipboard'
-import { isBrowser, useCopy } from 'common'
import { ThemeImage } from 'ui-patterns/ThemeImage'
import Avatar from '~/components/Avatar'
@@ -15,16 +12,15 @@ import Quote from '~/components/Quote'
import Chart from '~/components/Charts/PGCharts'
import InlineCodeTag from '~/components/InlineCode'
import {
+ Admonition,
Badge,
+ cn,
Collapsible_Shadcn_,
CollapsibleTrigger_Shadcn_,
CollapsibleContent_Shadcn_,
- IconTriangle,
- cn,
- Admonition,
- IconLink,
- IconCheck,
Heading,
+ IconArrowUpRight,
+ IconTriangle,
} from 'ui'
import ImageFadeStack from '~/components/ImageFadeStack'
import ZoomableImg from '~/components/ZoomableImg/ZoomableImg'
@@ -46,6 +42,12 @@ const getCaptionAlign = (align?: 'left' | 'center' | 'right') => {
}
}
+const LinkComponent = (props: PropsWithChildren<HTMLAnchorElement>) => (
+ <a href={props.href} target={props.target} className="inline-flex">
+ {props.children} {props.target === '_blank' && <IconArrowUpRight className="w-3" />}
+ </a>
+)
+
const BlogCollapsible = ({ title, ...props }: { title: string }) => {
return (
<Collapsible_Shadcn_>
@@ -129,11 +131,8 @@ export default function mdxComponents(type?: 'blog' | 'lp' | undefined) {
)}
</figure>
),
- Link: (props: PropsWithChildren<HTMLAnchorElement>) => (
- <a href={props.href} target={props.target}>
- {props.children}
- </a>
- ),
+ Link: LinkComponent,
+ a: LinkComponent,
code: (props: any) => <InlineCodeTag>{props.children}</InlineCodeTag>,
BlogCollapsible: (props: any) => <BlogCollapsible {...props} />,
Admonition,
diff --git a/packages/config/tailwind.config.js b/packages/config/tailwind.config.js
index ceddd9cc0f6..8216cb3a840 100644
--- a/packages/config/tailwind.config.js
+++ b/packages/config/tailwind.config.js
@@ -245,17 +245,18 @@ const uiConfig = ui({
},
a: {
position: 'relative',
- transition: 'color 0.3s ease-in-out',
+ transition: 'all 0.18s ease',
paddingBottom: '2px',
fontWeight: '400',
+ opacity: 1,
color: 'hsl(var(--foreground-default))',
textDecorationLine: 'underline',
- textDecorationColor: 'hsl(var(--brand-500))',
+ textDecorationColor: 'hsl(var(--foreground-muted))',
textDecorationThickness: '1px',
- textUnderlineOffset: '4px',
+ textUnderlineOffset: '2px',
},
'a:hover': {
- textDecorationColor: 'hsl(var(--colors-scale12))',
+ textDecorationColor: 'hsl(var(--foreground-default))',
},
figcaption: {
color: 'hsl(var(--foreground-muted))',