mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
## 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 -->
112 lines
3.7 KiB
TypeScript
112 lines
3.7 KiB
TypeScript
import styles from '~/styles/animations.module.css'
|
|
import { PlayCircle } from 'lucide-react'
|
|
import Image from 'next/image'
|
|
import Link from 'next/link'
|
|
import { Button, cn } from 'ui'
|
|
|
|
import AnnouncementBadge from '../Announcement/Badge'
|
|
import ProductIcon from '../ProductIcon'
|
|
|
|
interface Types {
|
|
h1: string | React.ReactNode
|
|
subheader: string | React.ReactNode
|
|
icon?: string
|
|
className?: string
|
|
title?: string
|
|
image?: string | React.ReactNode
|
|
footer?: React.ReactNode
|
|
announcement?: {
|
|
url: string
|
|
announcement: string
|
|
badge?: string
|
|
target?: '_self' | '_blank' | string
|
|
}
|
|
cta?: {
|
|
label?: string
|
|
link: string
|
|
icon?: React.ReactNode
|
|
}
|
|
secondaryCta?: {
|
|
label?: string
|
|
link: string
|
|
icon?: React.ReactNode
|
|
}
|
|
video?: string
|
|
}
|
|
|
|
const ProductHeaderCentered = (props: Types) => (
|
|
<div className={cn('container relative w-full mx-auto px-6 sm:px-16 xl:px-20', props.className)}>
|
|
<div className="flex flex-col text-center items-center">
|
|
{props.image &&
|
|
(typeof props.image === 'string' ? (
|
|
<div className="relative w-full max-w-[630px] mx-auto z-0 aspect-[2.3/1] -mt-8 -mb-8 md:-mb-12 lg:-mb-12">
|
|
<Image
|
|
src={props.image}
|
|
priority
|
|
layout="fill"
|
|
objectFit="contain"
|
|
objectPosition="top"
|
|
alt=""
|
|
/>
|
|
</div>
|
|
) : (
|
|
<div className="col-span-12 mt-8 lg:col-span-7 lg:mt-0 xl:col-span-6 xl:col-start-7">
|
|
{props.image}
|
|
</div>
|
|
))}
|
|
<div className="relative w-full z-10 flex flex-col items-center space-y-2 mx-auto max-w-2xl">
|
|
{props.announcement && (
|
|
<AnnouncementBadge {...props.announcement} className="pb-4 md:pb-4 z-10" />
|
|
)}
|
|
<div>
|
|
{props.icon || props.title ? (
|
|
<div className="mb-2 flex justify-center items-center gap-3">
|
|
{props.icon && <ProductIcon icon={props.icon} />}
|
|
{props.title && (
|
|
<span
|
|
className="text-primary font-mono uppercase tracking-widest text-sm"
|
|
key={`product-name-${props.title}`}
|
|
>
|
|
{props.title}
|
|
</span>
|
|
)}
|
|
</div>
|
|
) : null}
|
|
</div>
|
|
<div className={cn('flex flex-col items-center', styles['appear-from-bottom'])}>
|
|
<h1 className="h1 text-3xl md:text-4xl! lg:text-5xl! text-balance" key={`h1`}>
|
|
{props.h1}
|
|
</h1>
|
|
<p className="p text-foreground-light text-balance">{props.subheader}</p>
|
|
</div>
|
|
<div className="w-full sm:w-auto flex flex-col items-stretch sm:flex-row pt-2 sm:items-center gap-2">
|
|
{props.cta && (
|
|
<Button variant="primary" size="medium" iconRight={props.cta.icon} asChild>
|
|
<Link href={props.cta.link} as={props.cta.link}>
|
|
{props.cta.label ?? 'Start for free'}
|
|
</Link>
|
|
</Button>
|
|
)}
|
|
{props.video && (
|
|
<Button size="medium" icon={<PlayCircle />} asChild>
|
|
<Link href={props.video} as={props.video}>
|
|
Watch video
|
|
</Link>
|
|
</Button>
|
|
)}
|
|
{props.secondaryCta && (
|
|
<Button size="medium" iconRight={props.secondaryCta.icon} asChild>
|
|
<Link href={props.secondaryCta.link} as={props.secondaryCta.link}>
|
|
{props.secondaryCta.label}
|
|
</Link>
|
|
</Button>
|
|
)}
|
|
</div>
|
|
{props.footer && <div className="mb-4">{props.footer}</div>}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
|
|
export default ProductHeaderCentered
|