Files
bank/app/dash/vite.config.ts
zeekayandHanzo Dev 31159fd383 refactor(dash): remove Tailwind — the design system is ours now
The dash was grid-native on @hanzo/gui but still leaned on Tailwind for colour,
type and spacing. That dependency is gone: every utility class became a style
prop, and the handful of things an inline style cannot express — media queries,
descendant and pseudo selectors — became semantic classes in main.css named for
what they are (page, section, hero, hero-split, topbar, sheet, list, legend,
trade-split, the h1/h2/figure/display type scale).

main.css no longer imports a framework: @theme became plain :root, and the base
reset the components actually rely on (border-box, zeroed margins, headings
inheriting size and weight, controls inheriting font, svg display:block) is
written out rather than inherited from preflight. .btn and .chip were the last
two flexbox holdouts in CSS and are now inline-grid, so the app is grid
end to end.

Three fixes the conversion surfaced: the type-scale classes set font-size with
no leading, which would have put a 48px figure in a 24px line box; Exchange lost
its wide split (restored as .trade-split); and CopyRow/Wordmark gained the
style/size props the call sites needed instead of wrapper elements.

Colours stay as CSS custom properties — that is our own token system and the
white-label brand switch depends on it.

CSS 49.5 kB -> 14.2 kB (3.7 kB gzip). tsc, build, 34/34 e2e green, zero console
errors, no horizontal overflow at 1280 or 390.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-24 10:26:27 -07:00

37 lines
1.2 KiB
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { hanzoguiPlugin } from '@hanzogui/vite-plugin'
import { resolve } from 'path'
export default defineConfig({
plugins: [
react(),
// The @hanzo/gui grid runtime: compiles styled components to grid-css and
// wires the design config. optimize:false keeps the dev loop fast.
hanzoguiPlugin({ components: ['@hanzo/gui'], config: './hanzogui.config.ts', optimize: false }),
],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
// Web target: react-native's primitives resolve to react-native-web.
'react-native': 'react-native-web',
},
// @hanzo/iam ships its own React; dedupe so hooks share one instance
// (otherwise: "Invalid hook call — more than one copy of React").
dedupe: ['react', 'react-dom'],
},
define: { 'process.env.TAMAGUI_TARGET': JSON.stringify('web') },
optimizeDeps: {
include: ['@hanzo/iam/browser', '@hanzo/iam/react'],
},
server: {
port: 3000,
proxy: {
'/v1': {
target: process.env.VITE_BANK_API_URL || 'http://localhost:8070',
changeOrigin: true,
},
},
},
})