feat: rename --font-cal to --font-heading + use Cal Sans UI (#26064)
* feat: rename --font-cal to --font-heading + use Cal Sans UI * chore: remove font-weight from font-heading elements and CSS variables Co-Authored-By: [email protected] <[email protected]> * chore: remove unneeded css vars * fix: cubic issues --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]> Co-authored-by: Rajiv Sahal <[email protected]>
This commit is contained in:
74 files changed
+159
-141
No files matched your search
@@ -11,7 +11,7 @@ export default function AppNotInstalledMessage({ appName }: { appName: string })
|
||||
<div className="mb-5 rounded-full bg-gray-100 p-3 dark:bg-[#292929] ">
|
||||
<Icon name="circle-alert" className="h-9 w-9 p-0.5" strokeWidth={1.5} />
|
||||
</div>
|
||||
<h3 className="font-cal mb-2 text-2xl font-semibold">{t("app_not_installed")}</h3>
|
||||
<h3 className="font-heading mb-2 text-2xl">{t("app_not_installed")}</h3>
|
||||
<p className="text-subtle px-1 leading-normal">{t("visit_our_app_store")}</p>
|
||||
|
||||
<div className="mt-5">
|
||||
|
||||
@@ -118,7 +118,7 @@ export const SearchDialog = (props: ISearchDialog) => {
|
||||
return (
|
||||
<Dialog open={isOpenDialog} onOpenChange={setIsOpenDialog}>
|
||||
<DialogContent>
|
||||
<h3 className="font-cal text-emphasis text-xl" id="modal-title">
|
||||
<h3 className="font-heading text-emphasis text-xl" id="modal-title">
|
||||
{t("add_gif_to_confirmation")}
|
||||
</h3>
|
||||
<p className="text-subtle mb-3 text-sm font-light">{t("find_gif_spice_confirmation")}</p>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
@theme inline {
|
||||
--font-sans: var(--font-sans);
|
||||
--font-cal: var(--font-cal);
|
||||
--font-heading: var(--font-heading);
|
||||
|
||||
/* Resets the preference from coss-ui which was to "use single --radius variable for all radius values" */
|
||||
--radius: var(--radius);
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
"./styles.css": "./src/styles/globals.css",
|
||||
"./lib/*": "./src/lib/*.ts",
|
||||
"./components/*": "./src/components/*.tsx",
|
||||
"./hooks/*": "./src/hooks/*.ts"
|
||||
"./hooks/*": "./src/hooks/*.ts",
|
||||
"./fonts": "./src/fonts/index.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "biome lint src",
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,49 @@
|
||||
# Shared Fonts
|
||||
|
||||
This directory contains shared font files and configurations used across all apps in the monorepo.
|
||||
|
||||
## Usage
|
||||
|
||||
Import fonts directly from the shared UI package:
|
||||
|
||||
```tsx
|
||||
import { fontSans, fontHeading } from "@coss/ui/fonts";
|
||||
|
||||
export default function RootLayout({ children }) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body className={`${fontSans.variable} ${fontHeading.variable}`}>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
## Available Fonts
|
||||
|
||||
- `fontSans` - Cal Sans UI variable font (supports multiple weights and modes)
|
||||
- `fontHeading` - Cal Sans Regular font
|
||||
|
||||
## Adding New Fonts
|
||||
|
||||
1. Place the font file in this directory (`packages/coss-ui/src/fonts/`)
|
||||
2. Add a new font configuration in `index.ts`:
|
||||
|
||||
```typescript
|
||||
export const yourNewFont = localFont({
|
||||
display: "swap",
|
||||
src: "./YourFont.woff2",
|
||||
variable: "--font-your-name",
|
||||
});
|
||||
```
|
||||
|
||||
3. Use it in any app by importing from `@coss/ui/fonts`
|
||||
|
||||
## Benefits of This Approach
|
||||
|
||||
- Single source of truth for fonts
|
||||
- No fragile relative paths
|
||||
- Type-safe imports
|
||||
- Versioned with the UI package
|
||||
- Easy to update across all apps
|
||||
@@ -0,0 +1,13 @@
|
||||
import localFont from "next/font/local";
|
||||
|
||||
export const fontSans = localFont({
|
||||
display: "swap",
|
||||
src: "./CalSansUI[MODE,wght].woff2",
|
||||
variable: "--font-sans",
|
||||
});
|
||||
|
||||
export const fontHeading = localFont({
|
||||
display: "swap",
|
||||
src: "./CalSans-SemiBold.woff2",
|
||||
variable: "--font-heading",
|
||||
});
|
||||
@@ -63,7 +63,7 @@ export default function Header({
|
||||
)}
|
||||
<div>
|
||||
{title ? (
|
||||
<h1 className="font-cal text-emphasis mb-1 text-xl font-semibold leading-5 tracking-wide">
|
||||
<h1 className="font-heading text-emphasis mb-1 text-xl leading-5 tracking-wide">
|
||||
{title}
|
||||
</h1>
|
||||
) : (
|
||||
|
||||
@@ -242,7 +242,6 @@
|
||||
"Courier New", monospace;
|
||||
--radius: var(--radius);
|
||||
--font-heading: var(--font-heading);
|
||||
--font-cal: var(--font-cal);
|
||||
--shadow-dropdown: var(--shadow-dropdown);
|
||||
--shadow-switch-thumb: var(--shadow-switch-thumb);
|
||||
--shadow-solid-gray-rested: var(--shadow-solid-gray-rested);
|
||||
@@ -4949,14 +4948,14 @@
|
||||
.align-top {
|
||||
vertical-align: top;
|
||||
}
|
||||
.\!font-cal {
|
||||
font-family: var(--font-cal) !important;
|
||||
.\!font-heading {
|
||||
font-family: var(--font-heading) !important;
|
||||
}
|
||||
.font-\(family-name\:--font-sans\) {
|
||||
font-family: var(--font-sans);
|
||||
}
|
||||
.font-cal {
|
||||
font-family: var(--font-cal);
|
||||
.font-heading {
|
||||
font-family: var(--font-heading);
|
||||
}
|
||||
.font-mono {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New,
|
||||
@@ -9270,8 +9269,8 @@
|
||||
.prose-headings\:text-emphasis :where(h1, h2, h3, h4, h5, h6, th):not(:where([class~="not-prose"] *)) {
|
||||
color: var(--cal-text-emphasis);
|
||||
}
|
||||
.prose-h3\:font-cal :where(h3):not(:where([class~="not-prose"] *)) {
|
||||
font-family: var(--font-cal);
|
||||
.prose-h3\:font-heading :where(h3):not(:where([class~="not-prose"] *)) {
|
||||
font-family: var(--font-heading);
|
||||
}
|
||||
.prose-h3\:text-white :where(h3):not(:where([class~="not-prose"] *)) {
|
||||
color: var(--color-white);
|
||||
|
||||
@@ -85,7 +85,7 @@ const cvaCardTypeByVariant = cva("", {
|
||||
{
|
||||
variant: "SidebarCard",
|
||||
structure: "title",
|
||||
className: "text-sm font-cal",
|
||||
className: "text-sm font-heading",
|
||||
},
|
||||
{
|
||||
variant: "SidebarCard",
|
||||
@@ -107,7 +107,7 @@ const cvaCardTypeByVariant = cva("", {
|
||||
{
|
||||
variant: "NewLaunchSidebarCard",
|
||||
structure: "title",
|
||||
className: "text-sm font-cal text-white",
|
||||
className: "text-sm font-heading text-white",
|
||||
},
|
||||
{
|
||||
variant: "NewLaunchSidebarCard",
|
||||
|
||||
@@ -65,7 +65,7 @@ export const ConfirmationContent = (props: PropsWithChildren<ConfirmationDialogC
|
||||
</div>
|
||||
)}
|
||||
<div className="w-full">
|
||||
<DialogPrimitive.Title className="font-cal text-emphasis mt-2 text-xl">
|
||||
<DialogPrimitive.Title className="font-heading text-emphasis mt-2 text-xl">
|
||||
{title}
|
||||
</DialogPrimitive.Title>
|
||||
<DialogPrimitive.Description asChild>
|
||||
|
||||
@@ -129,7 +129,7 @@ export function DialogHeader(props: DialogHeaderProps) {
|
||||
<div className="mb-4">
|
||||
<h2
|
||||
data-testid="dialog-title"
|
||||
className="text-semibold text-emphasis font-cal mb-1 text-xl"
|
||||
className="text-emphasis font-heading mb-1 text-xl"
|
||||
id="modal-title">
|
||||
{props.title}
|
||||
</h2>
|
||||
|
||||
@@ -67,7 +67,7 @@ export function EmptyScreen({
|
||||
<div className={`flex ${limitWidth ? "max-w-[420px]" : ""} flex-col items-center`}>
|
||||
<h2
|
||||
className={classNames(
|
||||
"text-semibold font-cal text-emphasis text-center text-xl normal-nums",
|
||||
"font-heading text-emphasis text-center text-xl normal-nums",
|
||||
icon && "mt-6",
|
||||
!description && "mb-8"
|
||||
)}>
|
||||
|
||||
@@ -61,7 +61,7 @@ export function WizardForm({
|
||||
<div className="mx-auto mt-4 print:w-full" data-testid="wizard-form">
|
||||
<div className={classNames("overflow-hidden md:mb-2 md:w-[700px]", containerClassname)}>
|
||||
<div className="px-6 py-5">
|
||||
<h1 className="font-cal text-emphasis text-2xl" data-testid="step-title">
|
||||
<h1 className="font-heading text-emphasis text-2xl" data-testid="step-title">
|
||||
{currentStepData.title}
|
||||
</h1>
|
||||
<p className="text-subtle text-sm" data-testid="step-description">
|
||||
|
||||
@@ -46,7 +46,7 @@ export function WizardLayout({
|
||||
<header>
|
||||
{isLocaleReady ? (
|
||||
<>
|
||||
<p className="font-cal mb-3 text-[28px] font-medium leading-7">
|
||||
<p className="font-heading mb-3 text-[28px] leading-7">
|
||||
{title.replace(` | ${APP_NAME}`, "")}
|
||||
</p>
|
||||
<p className="text-subtle font-sans text-sm font-normal">{subtitle} </p>
|
||||
|
||||
Reference in new issue
Block a user