From 71eea8f649c4656d07d7e357c72b3149748ffc99 Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Mon, 24 Feb 2025 22:14:34 +0500 Subject: [PATCH 1/2] Added visited styles for links --- src/components/mdx/CustomLink.tsx | 8 ++++---- tailwind.config.ts | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/mdx/CustomLink.tsx b/src/components/mdx/CustomLink.tsx index 3e9285f6d..4e8530259 100644 --- a/src/components/mdx/CustomLink.tsx +++ b/src/components/mdx/CustomLink.tsx @@ -29,7 +29,7 @@ export const CustomLink: React.FC = ({ // Handling external links if (href.startsWith('http')) { return ( - + {children} ); @@ -38,7 +38,7 @@ export const CustomLink: React.FC = ({ // Handling anchor links if (href.startsWith('#')) { return ( - + {children} ); @@ -61,7 +61,7 @@ export const CustomLink: React.FC = ({ return ( - + {children} @@ -75,7 +75,7 @@ export const CustomLink: React.FC = ({ // Internal links handled by Next.js Link component return ( - + {children} {/* Ensuring is used inside for custom attributes like 'className' */} diff --git a/tailwind.config.ts b/tailwind.config.ts index c3e56525c..bea651ac7 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -45,6 +45,7 @@ export default { '00': '#030106', '01': '#120720', '02': '#291242', + '06': '#914BDC', '07': '#A96AF3', '08': '#BE8CFF', '11': '#FAF4FF', From 724be3e30afc572f4661934f71949507b2a6ea47 Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Tue, 4 Mar 2025 20:11:08 +0500 Subject: [PATCH 2/2] Updated link styles --- src/components/Prose.tsx | 6 ++-- src/components/mdx/CustomLink.tsx | 46 +++++++++++++++---------------- tailwind.config.ts | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/components/Prose.tsx b/src/components/Prose.tsx index f98e1e5e6..9bf525ae1 100644 --- a/src/components/Prose.tsx +++ b/src/components/Prose.tsx @@ -21,9 +21,9 @@ export function Prose({ // lead 'prose-lead:text-slate-500 dark:prose-lead:text-dark-text-secondary', // links - 'prose-a:font-semibold dark:prose-a:text-link', + 'prose-a:font-semibold prose-a:text-vermilion-00 hover:prose-a-text:[#606060] visited:text-[#4A4A4A] hover:visited:text-[#606060] dark:prose-a:vermilion-11 dark:hover:prose-a:dark-text-secondary dark:visited:text-[#606060] dark:hover:visited:text-[#A9A9A9]', // link underline - 'prose-a:underline prose-a:decoration-link-light hover:prose-a:text-link-light hover:prose-a:underline dark:prose-a:no-underline dark:hover:prose-a:underline', + 'prose-a:underline hover:prose-a:text-[#606060] hover:prose-a:underline dark:prose-a:underline dark:hover:prose-a:underline', // pre 'prose-pre:rounded-xl prose-pre:bg-slate-900 prose-pre:shadow-lg dark:prose-pre:bg-slate-800/60 dark:prose-pre:shadow-none dark:prose-pre:ring-1 dark:prose-pre:ring-slate-300/10', // hr @@ -31,7 +31,7 @@ export function Prose({ //table head alignment 'prose-th:table-cell', // Strong - 'prose-strong:text-dark-bg dark:prose-strong:text-dark-text-primary', + 'prose-strong:text-vermilion-08 dark:prose-strong:text-vermilion-08', // Inline code block 'prose-code:before:content-none prose-code:after:content-none', // Video diff --git a/src/components/mdx/CustomLink.tsx b/src/components/mdx/CustomLink.tsx index 4e8530259..3ec270ce2 100644 --- a/src/components/mdx/CustomLink.tsx +++ b/src/components/mdx/CustomLink.tsx @@ -2,9 +2,9 @@ import Link from 'next/link'; import React from 'react'; import { BookOpenText } from 'lucide-react'; import { - HoverCard, - HoverCardContent, - HoverCardTrigger, + HoverCard, + HoverCardContent, + HoverCardTrigger, } from "@/components/ui/hoverCard"; interface CustomLinkProps @@ -29,7 +29,7 @@ export const CustomLink: React.FC = ({ // Handling external links if (href.startsWith('http')) { return ( - + {children} ); @@ -38,44 +38,44 @@ export const CustomLink: React.FC = ({ // Handling anchor links if (href.startsWith('#')) { return ( - + {children} ); } const highlightCode = (text: string) => { - return text.split(/(`.+?`)/g).map((part: string, index: number) => - part.startsWith('`') && part.endsWith('`') ? ( - - {part.slice(1, -1)} - - ) : ( - part - ) - ); - }; + return text.split(/(`.+?`)/g).map((part: string, index: number) => + part.startsWith('`') && part.endsWith('`') ? ( + + {part.slice(1, -1)} + + ) : ( + part + ) + ); + }; - // If there's a title, wrap the content in a HoverCard for tooltip - if (rest?.title) { - return ( + // If there's a title, wrap the content in a HoverCard for tooltip + if (rest?.title) { + return ( - + {children} -
{children}
+
{children}
{highlightCode(rest.title || '')}
- ); - } + ); + } // Internal links handled by Next.js Link component return ( - + {children} {/* Ensuring is used inside for custom attributes like 'className' */} diff --git a/tailwind.config.ts b/tailwind.config.ts index bea651ac7..4c5cb7a8b 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -66,7 +66,7 @@ export default { light: '#F34E3F', // Teal-07 DEFAULT: '#FF7867', // Teal-08 }, - 'link-underline': '#002533', // Teal-02 + 'link-underline': '#606060', // Teal-02 'link-underline-light': '#EAFCFF', // Teal-11 // Brand Colors black: '#060000',