Done (PostCSS @apply comparison variant) #
PostCSS-pipeline implementation of ../done,
kept as a reference point for
comparing CSS frameworks at full-app scale.
Same product spec,
AI prompts,
database schema,
and HTTP routes;
the only axis that differs is the CSS authoring approach.
See ../done/README.md for the canonical product description.
This README only documents what this variant changes.
Why this variant exists #
../done is the canonical implementation and uses h-css (typed TypeScript composition;
see PHILOSOPHY.css.md).
This done-postcss package implements the same UI using the PostCSS @mixin + @apply
pipeline (via @monochromatic-dev/build-tool-css) so reviewers can diff the two approaches
side by side at the same scale.
The package is kept buildable while the comparison is useful.
It is not part of the shipped product and should not be extended with done-only features.
Differences from ../done #
CSS authoring #
donewrites mixins as TypeScript functions returningCssDeclarationsinsrc/client/mixins.ts, composed via object spread.done-postcsswrites them insrc/client/mixins.csswith@define-mixin/@applysyntax.donebuilds global styles inside TypeScript (styles.tsplus per-layer modules).done-postcsswrites them insrc/client/styles.cssand imports the compiled output withwith { type: 'text' }.- Component-level Shadow DOM styles in
doneare$({ rule, decls, children })calls with typed value constructors (cssRem,cssVar,cssInt). Indone-postcssthey arecss(`@apply --foo; ...`)template strings expanded at runtime bybuild-tool-css.
Build pipeline #
donehas nobuild:csstask and no startup CSS step; h-css emits CSS inside the TypeScript bundles at build time, or inline at SSR time.done-postcsshas amise run build:csstask that compilesstyles.cssintodist/css/, andsrc/server.tscallsbuildCSS()at startup to refresh the compiled output.
Dependencies #
donedepends on the workspace's shared@monochromatic-dev/module-hyperscript.done-postcssadditionally depends on@monochromatic-dev/build-tool-cssandpostcss, plus the@monochromatic-dev/rolldown-plugin-import-attributesdevDependency that lets client code import pre-built CSS viawith { type: 'text' }.
tsdown config #
done'stsdown.client.config.tsregisters no extra plugins.done-postcss's config registersimportAttributesPlugin()so the client bundle can inline the pre-built CSS string.
How it runs #
Client JS is bundled by tsdown as a separate build step (mise run build:js:client).
CSS compilation (build-css) still runs at server startup.
In development,
mise run dev:site uses mise watch to restart the process on any source change.
mise run build:js:client # bundle client scripts
node src/server.ts # start server (compiles CSS at startup)
mise run dev:site # development (auto-restart on src/ change via mise watch)
Architecture overview #
Single h3 server process handling both page routes (HTML) and API routes (JSON).
- CSS:
@monochromatic-dev/build-tool-cssresolves@importand expands@mixin/@applyinto plain CSS - Client JS:
tsdown bundles one entry per page (inbox,
in-progress,
task-details,
search,
settings) via
mise run build:js:client - Server:
h3
H3route registration plus h3 static serving for built client assets fromdist/client/ - Database: SQLite (@tursodatabase/database) with FTS5 full-text search, initialized via side-effect import at startup
- Client:
Vanilla TypeScript with custom elements;
reads server-embedded JSON from
<script id="page-data">, builds DOM imperatively
Monorepo dependencies #
@monochromatic-dev/build-tool-css: CSS@mixin/@applyexpansion pipeline@monochromatic-dev/module-hyperscript: h-html, h-dom factories (h-css is unused here)
This package runs only within the Monochromatic monorepo.
Lifecycle #
This package is reference scaffolding. It exits in one of two ways:
- Mirrored away:
kept as long as the side-by-side comparison with
../doneis useful for evaluating h-css or for benchmarking against future framework variants (done-tailwind,done-vanilla-extract, etc.). - Retired:
deleted once its comparison value is exhausted.
Record the rejection reason in a decision doc under
doc/decision/.
Until retired,
mirror behaviour changes from ../done only when the comparison's
coverage of the PostCSS surface needs to stay in sync.
Do not extend this variant with features that have not landed in ../done first.
Decision: no ORM #
Inherited from ../done.
Drizzle ORM was evaluated as the strongest TypeScript ORM
candidate and rejected because the database layer relies heavily on SQLite-specific
features that Drizzle cannot model natively:
- FTS5 virtual tables for full-text search
- Triggers that keep the FTS index in sync with the tasks table
json_each()table-valued function for querying JSON arrays stored in columns- Partial indexes (
WHERE due_date IS NOT NULL, etc.)
The current approach uses named SQL constants extracted to the top of each file.
Further reading #
../done/README.md: Canonical product descriptionPHILOSOPHY.css.md(repo root): Why h-css replaces this PostCSS approachpackage/build-tool/css/README.md:@mixin/@applypipeline detailsPLAN.md: Implementation plan with DB schema, AI prompts, and deployment detailsSPEC.md: Product specification (task model, screens, sync targets)FRAMEWORK_EVALUATION.md: Historical evaluation of vanilla TS plus Bun before the Node migration