Warning
Tempest 3 is out, but require PHP 8.5. I can not update now, but provide a v3 branch later.
The „class="$this->class"-Bug“ is fixed in v3.0.
Components for Tempest Framework with Pico CSS + UnoCSS
Warning
Tempest 3 is out, but require PHP 8.5. I can not update now, but provide a v3 branch later.
The „class="$this->class"-Bug“ is fixed in v3.0.
This is a example page to show some of the features of Tempest Pico. For a list of components and their documentation, check out the Components page.
I still miss XHP! Every time I try a “modern” PHP template engine, I feel like I’m back in the Stone Age.
Full Markdown (Tempests x-markdown only use core Markdown)
Front Matter support
Makes use of Front Matter
HTML like <a /> is displayed
Pico as base CSS for semantic HTML without scores and scores of classes.
ACSS UnoCSS for additional CSS
You can add CSS inside Markdown, just run pnpm unocss --watch and add {class="…"} to your MD (or Component).
The Headline above is styled with { class="bg-pico-primary-background text-pico-primary-inverse text-center" }, wich make use of the Pico custom properties.
This paragraf is styled using the class text-pico-primary
I like the short class names of the good old ACSS. May I go back to it.
| CSS | ACSS class | Tailwind class |
|---|---|---|
| color:red; | C(red) | text-red |
| text-align: justify; | Ta(j) | text-justify |
| text-align-last: center; | Tal(c) | {I don’t know} |
.striped is a Pico class for striped Tables btw.
The shortcut {.class} only works for known classes or static Pages. UnoCSS (and other utilities) don’t detect classes without class=. For static Pages I simply run UnoCSS over the generated HTML.
TODO:sError
Just a example Error Msg…
I prefer semantic CSS (and HTML) + utility CSS for Modifiers (like the M in BEM). (+ Components with scoped CSS, if necessary).
My code is below /src, /app is the default Tempest (v2) example, just as static page + Header.
Take a look at my Example as GitHub Page and compare the sources.
I like to have my IDE and static code analysis tools understand my code as much as possible. I don’t want to have to guess what variables are available in the template, or what methods I can call on $this.
Dynamic components only take a string as attribute, so you can’t pass anything else.
composer create-project tempest/app=2 <= note the =2 for PHP 8.4
Until the basic work is done, I have to stay on 8.4. The unmaintained code i want to replace is not PHP 8.5 compatible.
$ pnpm unocss --watch
composer gen deletes all public/*.html files, generates the static sites again and then the css.
If you generate the Pages on the same Environment you develop: Use ./tempest static:clean after deploying to remove the generated static files, so you don’t use old files.
You can use my .github/workflows/deploy.yml if you want Tempest for your Github Pages.