{"slug": "i-gave-my-schema-viewer-your-app-s-colours", "title": "I gave my schema viewer your app's colours", "summary": "Laravel Truss 1.6 adds theming to match the app it's embedded in and a truss:export command for deterministic schema files, according to a blog post by Alberto Arena. The update introduces configurable colors and fonts under truss.theme, a theme builder at trussphp.com/theme-builder, and a CLI export supporting five formats with a --check flag for CI gating. The export command exits with code 1 when the committed schema file drifts from the database, enabling automated drift detection.", "body_md": "Laravel\n\n# I gave my schema viewer your app's colours\n\nLaravel Truss 1.6 adds theming to match the app it's embedded in, and truss:export to generate deterministic schema files your CI can gate on.\n\n## On this page\n\n## Truss series\n\n- 1\n[There's no artisan schema:show, so I built one](/posts/introducing-truss/) - 2\n[The schema doctor is in](/posts/the-schema-doctor-is-in/) - 3 I gave my schema viewer your app's colours\n- 4\n[My coding agent kept inventing columns](/posts/my-coding-agent-kept-inventing-columns/)\n\n[View series →](/series/truss/)\n\n[Truss](https://github.com/albertoarena/laravel-truss) is a live, zoomable ER diagram of your Laravel app’s actual database schema, safe to run in production because it only ever reads structure. I introduced it [back in July](/posts/introducing-truss/), and it’s been part of every client project since, gated behind a `viewTruss`\n\npolicy. Two things kept nagging at me. The dashboard was always Truss blue, whatever the client’s actual brand was, so it looked bolted onto their app rather than part of it. And the export button, one click for a Markdown data dictionary or a DBML file, only ever got clicked when I remembered to, so the schema file committed to the repo drifted quietly from the real one until someone noticed, usually the hard way.\n\nTruss 1.6 fixes both: a themeable dashboard that matches whatever it’s embedded in, and a `truss:export`\n\ncommand that puts the same output in your terminal and your CI pipeline, no browser required.\n\n## Match it to your app\n\nColours and fonts now live under `truss.theme`\n\nin config, and Truss re-skins itself in both light and dark mode:\n\n``` js\n// config/truss.php\n'theme' => [\n    'colors' => [\n        'light' => [\n            'accent' => '#b45309',\n            'accent-secondary' => '#0f766e',\n            'background' => '#faf6f0',\n            'surface' => '#fffdf8',\n            'text' => '#3a2a1c',\n            'border' => '#c8873f',\n        ],\n        'dark' => [\n            'accent' => '#fbbf24',\n            'background' => '#1b130b',\n            'surface' => '#26190d',\n            'text' => '#f5e6d0',\n            'border' => '#8a6428',\n        ],\n    ],\n],\n```\n\nOnly the knobs you set are overridden, everything else stays on the default Blueprint palette, so three or four values are enough to make it look at home. The re-skin runs deep: the diagram’s relationship lines, label backdrops, background grid, table rows, and inputs all follow, not just the toolbar chrome. It ships as a same-origin stylesheet, no build step, `style-src 'self'`\n\nstill covers it, and a default install adds no extra request at all. Each value is validated before it’s written, so a typo falls back to the default instead of breaking the sheet.\n\nPicking hex values by hand isn’t required. The new [theme builder](https://trussphp.com/theme-builder/) previews a palette against the real dashboard live, starts from presets (Blueprint, Ember, Contrast) if you’d rather tweak than start blank, and generates the exact `config/truss.php`\n\nsnippet to paste in.\n\n## Get a schema file without opening a browser\n\n```\nphp artisan truss:export --format=dbml --output=docs/schema.dbml\nphp artisan truss:export --format=json --check\n```\n\n`truss:export`\n\nis the export button’s command-line counterpart: the same five formats (DBML, JSON, CSV, Markdown data dictionary, Mermaid), generated straight from PHP, no browser involved. Output is deterministic, the same schema always produces the same bytes, which is what makes `--check`\n\nworth running: point it at the file you’ve committed, and it exits `1`\n\nthe moment that file stops matching the database, `2`\n\non a usage error, `0`\n\nwhen everything lines up. Wire it into a commit hook or CI, and schema drift stops being something a reviewer has to notice by eye. Structure only, as always, no network call.\n\n## Try it\n\n- Theme builder:\n[trussphp.com/theme-builder](https://trussphp.com/theme-builder/) - Live demo:\n[trussphp.com/demo](https://trussphp.com/demo/) - Theming guide:\n[trussphp.com/guides/theming](https://trussphp.com/guides/theming/) - Schema export guide:\n[trussphp.com/guides/schema-export](https://trussphp.com/guides/schema-export/) - Changelog:\n[CHANGELOG.md on GitHub](https://github.com/albertoarena/laravel-truss/blob/main/CHANGELOG.md)\n\nUpdate with `composer update albertoarena/laravel-truss`\n\n.\n\n## What’s next\n\nLighthouse CI is next on the [roadmap](https://trussphp.com/roadmap/): automated performance and accessibility audits across both themes, light and dark. After that: more `truss:doctor`\n\nrules, reading Eloquent relationships for semantic labels instead of just foreign keys, and schema context formatted for AI agents working in the same codebase. If a theme knob is missing or `truss:export`\n\nshould support a format it doesn’t, [open a discussion](https://github.com/albertoarena/laravel-truss/discussions).\n\n## Notes\n\nOn August 4, 2026, replaced the link to the v1.6.0 release notes above with a link to the [full changelog](https://github.com/albertoarena/laravel-truss/blob/main/CHANGELOG.md), since v1.6.1 has since shipped a fix on top of it.\n\n[Open a discussion on GitHub](https://github.com/albertoarena/laravel-truss/discussions)or\n\n[send me an email](mailto:hello@albertoarena.it).", "url": "https://wpnews.pro/news/i-gave-my-schema-viewer-your-app-s-colours", "canonical_source": "https://albertoarena.it/posts/gave-my-schema-viewer-your-app-colours/", "published_at": "2026-08-03 10:00:00+00:00", "updated_at": "2026-08-20 11:14:22.659961+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Laravel Truss", "Alberto Arena", "trussphp.com/theme-builder", "trussphp.com/demo"], "alternates": {"html": "https://wpnews.pro/news/i-gave-my-schema-viewer-your-app-s-colours", "markdown": "https://wpnews.pro/news/i-gave-my-schema-viewer-your-app-s-colours.md", "text": "https://wpnews.pro/news/i-gave-my-schema-viewer-your-app-s-colours.txt", "jsonld": "https://wpnews.pro/news/i-gave-my-schema-viewer-your-app-s-colours.jsonld"}}