Skip to main content

Design System

Closegram's visual design is built on a shared Tailwind configuration (packages/tailwind-config) with a custom CSS variable token system and three-mode theming.

Theme modes

The ThemeContext supports three modes:

ModeBehavior
lightAlways light
darkAlways dark
systemFollows OS preference via prefers-color-scheme

The resolved theme (light or dark) is applied by toggling the class on <html>. Mode is persisted to localStorage.

const { theme, mode, setTheme, toggleTheme } = useTheme();
// theme: 'light' | 'dark' (resolved)
// mode: 'light' | 'dark' | 'system'

CSS custom properties

Defined in apps/frontend-nextjs/src/app/globals.css and applied globally:

TokenLightDarkUsage
--color-background#ffffff#000000Page background
--color-foreground#0f1419#e7e9eaBody text
--color-card#ffffff#16181cCard surfaces
--color-card-foreground#0f1419#e7e9eaText on cards
--color-border#eff3f4#2f3336Dividers, outlines
--color-input#f7f9f9#16181cInput backgrounds
--color-muted#f7f9f9#16181cSubtle backgrounds
--color-muted-foreground#536471#71767bSecondary text
--color-primary#1d9bf0#1d9bf0Brand blue (interactive)

Brand accent colors

Defined in packages/tailwind-config/shared-styles.css and extended in Tailwind:

TokenValueUsage
--color-blue-1000#2a8af6Highlights, links
--color-purple-1000#a853baCreator badge, gradient
--color-red-1000#e92a67Reactions, alerts

Card tokens (Tailwind colors.card)

KeyValue
card.light#ffffff
card.dark#191c1f

Logo color

KeyValue
logo.light#26292b
logo.dark#FFAA00

Typography

Body font stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif.

Custom brand font: BlueVinyl Bold (served from /assets/fonts/) — used in logo lockups.

The main nav (Navigation.tsx) is an icon sidebar that:

  • Collapses to icon-only by default
  • Expands on hover or when the "More" menu is open
  • Force-collapses if the collapsed prop is set
  • Highlights the active route via usePathname()

Nav items: Home, Search, Explore, Messages, Notifications, Create Post, plus a "More" overflow menu with theme switcher and logout.

App routes

RoutePage
/homeMain feed
/searchSearch
/messagesMessages
/coinsCoins & transactions
/paymentsPayments
/profileOwn profile
/[username]Public profile
/p/[postId]Post detail
/settingsSettings
/loginLogin

Shared packages

PackagePurpose
packages/tailwind-configShared Tailwind config + design tokens
packages/typescript-configShared tsconfig.json bases
packages/eslint-configShared ESLint rules
packages/graphqlSingle source of truth — GraphQL schema + operations (Web/Admin)
packages/apollo-webGenerated TS Apollo client for frontend-nextjs (auth, ws, upload links)
packages/apollo-adminGenerated TS Apollo client for frontend-admin
packages/apollo-swiftGenerated Swift ClosegramGraphQL module for apps/ios