Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/tauri/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
allowBuilds:
esbuild: true
onlyBuiltDependencies:
- esbuild
166 changes: 125 additions & 41 deletions apps/tauri/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,27 @@
import { onMounted, ref } from "vue";
import { invoke } from "@tauri-apps/api/core";
import { useShellStore } from "./stores/shell";
import {
applyTheme,
initTheme,
type QueryaThemeMode,
} from "./theme/queryaTheme";

const shell = useShellStore();
const backend = ref<string>("…");
const theme = ref<QueryaThemeMode>("system");

const swatches = [
{ name: "bg", varName: "--q-background" },
{ name: "card", varName: "--q-card" },
{ name: "primary", varName: "--q-primary" },
{ name: "muted", varName: "--q-muted-foreground" },
{ name: "border", varName: "--q-border" },
{ name: "destructive", varName: "--q-destructive" },
] as const;

onMounted(async () => {
theme.value = initTheme();
try {
const info = await invoke<{ name: string; stack: string; version: string }>(
"app_info",
Expand All @@ -18,74 +34,142 @@ onMounted(async () => {
shell.markReady();
}
});

function setTheme(mode: QueryaThemeMode) {
theme.value = mode;
applyTheme(mode);
}
</script>

<template>
<div class="shell">
<header class="brand">Querya</header>
<p class="tagline">Tauri 2 + Vue 3 shell (scaffold)</p>
<p class="tagline">Tauri 2 + Vue 3 — Querya tokens (no shadcn)</p>
<p class="meta" data-testid="backend-info">{{ backend }}</p>
</div>
</template>

<style>
:root {
color-scheme: light dark;
font-family: "Segoe UI", "SF Pro Text", system-ui, sans-serif;
line-height: 1.45;
font-weight: 400;
color: #1a1a1a;
background: #f3f1ec;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
:root {
color: #f2f0ea;
background: #161616;
}
}
<div class="swatches" aria-label="Querya token swatches">
<div v-for="s in swatches" :key="s.name" class="swatch">
<span class="chip" :style="{ background: `var(${s.varName})` }" />
<span class="label">{{ s.name }}</span>
</div>
</div>

* {
box-sizing: border-box;
}

html,
body,
#app {
margin: 0;
min-height: 100%;
height: 100%;
}
<div class="theme-row" role="group" aria-label="Theme">
<button
type="button"
class="btn"
:class="{ active: theme === 'system' }"
@click="setTheme('system')"
>
System
</button>
<button
type="button"
class="btn"
:class="{ active: theme === 'light' }"
@click="setTheme('light')"
>
Light
</button>
<button
type="button"
class="btn"
:class="{ active: theme === 'dark' }"
@click="setTheme('dark')"
>
Dark
</button>
</div>
</div>
</template>

<style scoped>
.shell {
min-height: 100%;
display: grid;
place-content: center;
gap: 0.35rem;
padding: 2rem;
gap: var(--q-space-2);
padding: var(--q-space-8);
text-align: center;
}

.brand {
font-size: clamp(2.5rem, 6vw, 4rem);
font-size: var(--q-text-hero);
font-weight: 650;
letter-spacing: -0.04em;
margin: 0;
color: var(--q-foreground);
}

.tagline {
margin: 0;
opacity: 0.72;
color: var(--q-muted-foreground);
}

.meta {
margin: 0.75rem 0 0;
font-size: 0.875rem;
opacity: 0.55;
margin: var(--q-space-3) 0 0;
font-size: var(--q-text-sm);
color: var(--q-muted-foreground);
font-variant-numeric: tabular-nums;
}

.swatches {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: var(--q-space-3);
margin-top: var(--q-space-6);
}

.swatch {
display: grid;
gap: var(--q-space-1);
justify-items: center;
}

.chip {
width: 2.25rem;
height: 2.25rem;
border-radius: var(--q-radius-md);
border: 1px solid var(--q-border);
box-shadow: var(--q-shadow-sm);
}

.label {
font-size: var(--q-text-xs);
color: var(--q-muted-foreground);
font-family: var(--q-font-mono);
}

.theme-row {
display: inline-flex;
gap: var(--q-space-2);
margin-top: var(--q-space-6);
padding: var(--q-space-1);
border-radius: var(--q-radius-lg);
background: var(--q-card);
border: 1px solid var(--q-border);
}

.btn {
appearance: none;
border: 0;
background: transparent;
color: var(--q-muted-foreground);
font: inherit;
font-size: var(--q-text-sm);
padding: var(--q-space-2) var(--q-space-3);
border-radius: var(--q-radius-md);
cursor: pointer;
}

.btn:hover {
color: var(--q-foreground);
background: var(--q-accent);
}

.btn.active {
color: var(--q-primary-foreground);
background: var(--q-primary);
}
</style>
4 changes: 4 additions & 0 deletions apps/tauri/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";
import "./styles/base.css";
import { initTheme } from "./theme/queryaTheme";

initTheme();

const app = createApp(App);
app.use(createPinia());
Expand Down
28 changes: 28 additions & 0 deletions apps/tauri/src/styles/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@import "./tokens.css";

*,
*::before,
*::after {
box-sizing: border-box;
}

html,
body,
#app {
margin: 0;
min-height: 100%;
height: 100%;
}

body {
font-family: var(--q-font-sans);
font-size: var(--q-text-md);
line-height: 1.45;
font-weight: 400;
color: var(--q-foreground);
background: var(--q-background);
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
120 changes: 120 additions & 0 deletions apps/tauri/src/styles/tokens.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/**
* Querya design tokens (CSS variables).
* Ported from Flutter QueryaUiColors / QueryaColors — no shadcn.
*
* Usage: `color: var(--q-foreground); background: var(--q-background);`
* Theme: set `data-theme="light"|"dark"` on <html>, or leave unset for
* prefers-color-scheme.
*/

:root {
/* Radius / elevation / type (shared) */
--q-radius-sm: 4px;
--q-radius-md: 8px;
--q-radius-lg: 12px;
--q-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.08);
--q-shadow-md: 0 4px 16px rgb(0 0 0 / 0.12);
--q-font-sans: "Segoe UI", "SF Pro Text", system-ui, sans-serif;
--q-font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
--q-text-xs: 0.75rem;
--q-text-sm: 0.875rem;
--q-text-md: 1rem;
--q-text-lg: 1.25rem;
--q-text-xl: 1.75rem;
--q-text-hero: clamp(2.5rem, 6vw, 4rem);
--q-space-1: 0.25rem;
--q-space-2: 0.5rem;
--q-space-3: 0.75rem;
--q-space-4: 1rem;
--q-space-6: 1.5rem;
--q-space-8: 2rem;
}

/* Light — QueryaTheme.lightDefault / QueryaUiColors */
:root,
:root[data-theme="light"] {
color-scheme: light;
--q-background: #fafafa;
--q-foreground: #0f172a;
--q-card: #ffffff;
--q-card-foreground: #0f172a;
--q-popover: #ffffff;
--q-popover-foreground: #0f172a;
--q-primary: #0e7490;
--q-primary-foreground: #ffffff;
--q-secondary: #f4f4f5;
--q-secondary-foreground: #0f172a;
--q-muted: #f4f4f5;
--q-muted-foreground: #64748b;
--q-accent: #e4e4e7;
--q-accent-foreground: #0f172a;
--q-destructive: #dc2626;
--q-destructive-foreground: #f8fafc;
--q-border: #e4e4e7;
--q-input: #e4e4e7;
--q-ring: #0e7490;
--q-chart-1: #2662d9;
--q-chart-2: #2eb88a;
--q-chart-3: #e88c30;
--q-chart-4: #af57db;
--q-chart-5: #e23670;
}

/* Dark — QueryaTheme.darkDefault / QueryaColors */
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
color-scheme: dark;
--q-background: #000000;
--q-foreground: #f8fafc;
--q-card: #0c0c0c;
--q-card-foreground: #f8fafc;
--q-popover: #0c0c0c;
--q-popover-foreground: #f8fafc;
--q-primary: #22d3ee;
--q-primary-foreground: #0a0a0a;
--q-secondary: #18181b;
--q-secondary-foreground: #f8fafc;
--q-muted: #18181b;
--q-muted-foreground: #94a3b8;
--q-accent: #27272a;
--q-accent-foreground: #f8fafc;
--q-destructive: #ef4444;
--q-destructive-foreground: #f8fafc;
--q-border: #27272a;
--q-input: #27272a;
--q-ring: #22d3ee;
--q-chart-1: #2662d9;
--q-chart-2: #2eb88a;
--q-chart-3: #e88c30;
--q-chart-4: #af57db;
--q-chart-5: #e23670;
}
}

:root[data-theme="dark"] {
color-scheme: dark;
--q-background: #000000;
--q-foreground: #f8fafc;
--q-card: #0c0c0c;
--q-card-foreground: #f8fafc;
--q-popover: #0c0c0c;
--q-popover-foreground: #f8fafc;
--q-primary: #22d3ee;
--q-primary-foreground: #0a0a0a;
--q-secondary: #18181b;
--q-secondary-foreground: #f8fafc;
--q-muted: #18181b;
--q-muted-foreground: #94a3b8;
--q-accent: #27272a;
--q-accent-foreground: #f8fafc;
--q-destructive: #ef4444;
--q-destructive-foreground: #f8fafc;
--q-border: #27272a;
--q-input: #27272a;
--q-ring: #22d3ee;
--q-chart-1: #2662d9;
--q-chart-2: #2eb88a;
--q-chart-3: #e88c30;
--q-chart-4: #af57db;
--q-chart-5: #e23670;
}
Loading
Loading