tidgrid.dev

Your agent has opinions about CSS. Revoke them.

One vocabulary lists every class a page may use. Everything else fails the check.

It shipped #ff0066. Nobody asked.

A new class here, a hex colour there, a style block when it is in a hurry. Nobody reviews CSS, and your agent knows it.

Your agent writes careers.html

<main>
<h1>Careers</h1>
<p style="color: #ff0066">Join us.</p>
<a class="btn-new">Apply</a>
</main>
<style>.btn-new { color: red }</style>

Merged this week

Live on your site

<p style="color: #ff0066">Join us.</p>
<a class="btn-new">Apply</a>
<style>.btn-new { color: red }</style>

Same agent. Same crap. Exit code 1.

Run before every commit, the check names the fix. The agent cleans up after itself. You never see it.

Your agent writes careers.html again

1 <main class="tg-col tg-gap(2)">
2 <h1 class="tg-text(title)">Careers</h1>
3 <p style="color: #ff0066">Join us.</p>
4 <a class="btn-new">Apply</a>
5 </main>
6 <style>.btn-new { color: red }</style>

Merged this week

tidgrid check, before the commit

$ tidgrid check
careers.html:1: unknown class tg-gap(2); tg-gap takes: sm md
careers.html:3: appearance in style attribute: color; use a role (`tidgrid list`)
careers.html:4: unknown class btn-new: not in the vocabulary; run `tidgrid list`
careers.html:6: own CSS: <style> block; make it a role in the vocabulary
…
$ echo $?
1

The whole look. Decided once.

Colours, spacing and every named look live in the vocabulary. Nothing else gets to have an opinion.

The vocabulary file

index.tg

color = tokens("color", {"ground": "#0f1214", "ink": "#e6e9eb", "accent": "#5ed5dc"})
border = tokens("border", {"hair": "1px"})
role("surface", "card",
    use = "A panel that lifts off the ground. One per group of related content.",
    css = {"border": "%s solid %s" % (border.hair, color.accent)})
role("text", "title",
    use = "The one title of a page.",
    css = {"color": color.accent})

It cannot guess. It has to read.

A guessed class fails the check. One command prints what exists and when to use it: your agent's entire CSS education.

How roles work

The agent's terminal, the roles

$ tidgrid list
…
# roles
## surface
tg-surface(card) A panel that lifts off the ground. One per group of related content.
## text
tg-text(title) The one title of a page.

No runtime. No framework. No plugin.

One binary writes one static stylesheet. Your pages link it like it is 2005.

.html .astro .jsx .tsx .vue .svelte .md .mdx .liquid .njk

Four commands. Then go do something else.

Add three lines to your agent's instructions and stop reading CSS diffs.

Your terminal

$ go install github.com/sneikki/tidgrid/cmd/tidgrid@latest
$ tidgrid init
$ tidgrid build
$ tidgrid check