Files
Danny White ec53175b8a refactor(ui): rename text-brand to text-primary (#50564)
## What kind of change does this PR introduce?

Refactor. Follow-up to #49871.

## What is the current behavior?

Branded (green) text still uses the `text-brand` classname while the
colour comes from `--primary`.

## What is the new behavior?

**Rename-only:** `text-brand` → `text-primary` across callsites and
docs. Leftover `bg-brand` / `border-brand` alias to `brand-default`. No
intentional colour changes in this PR.

This better matches how we treat our green in other components and
props, like `variant="primary"` for green buttons.

## To test

On light mode: smoke-test that branded text still looks like #49871
(readable green, not the bright fill).

-
[Homepage](https://zone-www-dot-com-git-dnywh-depr-316-text-brand-de2380-supabase.vercel.app/):
“Scale to millions” uses `text-primary`
- [Docs
homepage](https://docs-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/docs):
branded links like “More on self-hosting” are still readable
- [Typography
docs](https://design-system-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/design-system/docs/typography):
documents `text-primary`
- [Colour
usage](https://design-system-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/design-system/docs/color-usage):
`text-primary` is visibly darker than `bg-brand-default` _on light mode_
- [Studio auth
providers](https://studio-staging-git-dnywh-depr-316-text-brand-to-60fa6c-supabase.vercel.app/dashboard/project/_/auth/providers):
enabled provider badge text readable; status dot stays bright green

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Style**
* Updated branded text, link hover states, icons, badges, indicators,
and highlighted content across the Design System, Docs, Studio, Learn,
UI Library, and marketing experiences to use the primary theme color.
* Updated syntax highlighting and table-of-contents styling for
consistent primary-color presentation.
  * Refined brand color fallback behavior for bright fills and borders.

* **Documentation**
* Updated color-usage and typography guidance to recommend the primary
text utility.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-22 16:19:03 +10:00

161 lines
5.6 KiB
TypeScript

import DefaultLayout from '~/components/Layouts/Default'
import SectionContainerWithCn from '~/components/Layouts/SectionContainerWithCn'
import Panel from '~/components/Panel'
import data from '~/data/support'
import { Command, Search } from 'lucide-react'
import { NextSeo } from 'next-seo'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { useEffect, useRef } from 'react'
import { questions } from 'shared-data'
import Typed from 'typed.js'
import { Button, ButtonProps, cn } from 'ui'
import { CommandMenuTrigger } from 'ui-patterns/CommandMenu'
const Index = () => {
const router = useRouter()
const typerRef = useRef(null)
useEffect(() => {
const typed = new Typed(typerRef.current, {
strings: questions,
typeSpeed: 50,
backDelay: 4000,
showCursor: false,
})
return () => {
// Destroy Typed instance during cleanup to stop animation
typed.destroy()
}
}, [])
return (
<>
<NextSeo
title={data.meta_title}
description={data.meta_description}
openGraph={{
title: data.meta_title,
description: data.meta_description,
url: `https://supabase.com/${router.pathname}`,
images: [
{
url: `https://supabase.com/images/og/supabase-og.png`,
},
],
}}
/>
<DefaultLayout className="min-h-fit!">
<div className="bg-alternative">
<SectionContainerWithCn className="space-y-2 text-center">
<h1 className="text-primary font-mono text-base uppercase tracking-widest">
{data.hero.h1}
</h1>
<p className="h1 tracking-[-1px]">{data.hero.title}</p>
<CommandMenuTrigger>
<button
tabIndex={0}
className="
mx-auto
w-full
max-w-lg
flex
px-3
py-3
group
items-center
justify-between
bg-background
border
border-control
hover:bg-surface-100
transition
rounded-sm"
>
<div className="flex items-center flex-1 space-x-2">
<Search className="text-foreground-light" size={18} strokeWidth={2} />
<p
ref={typerRef}
className="text-foreground-lighter text-sm group-hover:text-foreground-light transition"
/>
</div>
<div className="flex items-center h-full space-x-1">
<div className="hidden text-foreground-lighter md:flex items-center justify-center h-5 w-10 border rounded-sm bg-surface-300 border-foreground-lighter/30 gap-1">
<Command size={12} strokeWidth={1.5} />
<span className="text-[12px]">K</span>
</div>
</div>
</button>
</CommandMenuTrigger>
</SectionContainerWithCn>
</div>
<SectionContainerWithCn
height="narrow"
className="text grid gap-5 md:grid-cols-2 xl:grid-cols-3"
>
{data.cards.map((card) => (
<Panel
key={card.title}
outerClassName={cn(card.className)}
innerClassName="flex flex-col p-5"
>
<div className="mb-4 lg:mb-8 flex-1">
<h2 className="text text-lg font-medium">{card.title}</h2>
<div className="my-2 block">
<p className="text-foreground-light">{card.paragraph}</p>
</div>
</div>
<div className="flex gap-2">
{card.links.map((link) => (
<Button
size="small"
variant={(link.type as ButtonProps['variant']) ?? 'default'}
iconRight={link.icon}
asChild
>
<Link href={link.link} as={link.link} target={link.target}>
{link.label}
</Link>
</Button>
))}
</div>
</Panel>
))}
<div className="col-span-full bg-alternative border rounded-xl p-6 lg:p-10">
<div className="grid grid-cols-1 lg:grid-cols-2 gap-2 xl:gap-16 justify-between">
<div className="gap-2 flex flex-col">
<h2 className="text-xl lg:text-2xl tracking-tight">{data.banner.title}</h2>
</div>
<div className="flex flex-col gap-4">
<div className="flex flex-col">{data.banner.paragraph}</div>
<div className="flex gap-2">
{data.banner.links.map((link) => (
<Button
size="tiny"
variant={(link.type as ButtonProps['variant']) ?? 'default'}
iconRight={link.icon}
asChild
>
<Link
href={link.link}
as={link.link}
target={link.target}
className={cn(link.className)}
>
{link.label}
</Link>
</Button>
))}
</div>
</div>
</div>
</div>
</SectionContainerWithCn>
</DefaultLayout>
</>
)
}
export default Index